daemon: fixed issue with dhcp service and dealing with addresses with a prefix of 32
This commit is contained in:
parent
7938379e6d
commit
dcf402ae04
2 changed files with 5 additions and 1 deletions
|
@ -149,6 +149,8 @@ class DhcpService(ConfigService):
|
||||||
subnets = []
|
subnets = []
|
||||||
for iface in self.node.get_ifaces(control=False):
|
for iface in self.node.get_ifaces(control=False):
|
||||||
for ip4 in iface.ip4s:
|
for ip4 in iface.ip4s:
|
||||||
|
if ip4.size == 1:
|
||||||
|
continue
|
||||||
# divide the address space in half
|
# divide the address space in half
|
||||||
index = (ip4.size - 2) / 2
|
index = (ip4.size - 2) / 2
|
||||||
rangelow = ip4[index]
|
rangelow = ip4[index]
|
||||||
|
|
|
@ -236,7 +236,7 @@ max-lease-time 7200;
|
||||||
ddns-update-style none;
|
ddns-update-style none;
|
||||||
"""
|
"""
|
||||||
for iface in node.get_ifaces(control=False):
|
for iface in node.get_ifaces(control=False):
|
||||||
cfg += "\n".join(map(cls.subnetentry, iface.ips()))
|
cfg += "\n".join(map(cls.subnetentry, iface.ip4s))
|
||||||
cfg += "\n"
|
cfg += "\n"
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
@ -246,6 +246,8 @@ ddns-update-style none;
|
||||||
Generate a subnet declaration block given an IPv4 prefix string
|
Generate a subnet declaration block given an IPv4 prefix string
|
||||||
for inclusion in the dhcpd3 config file.
|
for inclusion in the dhcpd3 config file.
|
||||||
"""
|
"""
|
||||||
|
if ip.size == 1:
|
||||||
|
return ""
|
||||||
address = str(ip.ip)
|
address = str(ip.ip)
|
||||||
if netaddr.valid_ipv6(address):
|
if netaddr.valid_ipv6(address):
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Add table
Reference in a new issue