Merge "Fix error getting segment_id in linux DHCP driver"
This commit is contained in:
commit
609aacadee
@ -869,6 +869,7 @@ class Dnsmasq(DhcpLocalProcess):
|
|||||||
isolated_subnets = self.get_isolated_subnets(self.network)
|
isolated_subnets = self.get_isolated_subnets(self.network)
|
||||||
for i, subnet in enumerate(self.network.subnets):
|
for i, subnet in enumerate(self.network.subnets):
|
||||||
addr_mode = getattr(subnet, 'ipv6_address_mode', None)
|
addr_mode = getattr(subnet, 'ipv6_address_mode', None)
|
||||||
|
segment_id = getattr(subnet, 'segment_id', None)
|
||||||
if (not subnet.enable_dhcp or
|
if (not subnet.enable_dhcp or
|
||||||
(subnet.ip_version == 6 and
|
(subnet.ip_version == 6 and
|
||||||
addr_mode == constants.IPV6_SLAAC)):
|
addr_mode == constants.IPV6_SLAAC)):
|
||||||
@ -914,11 +915,12 @@ class Dnsmasq(DhcpLocalProcess):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if subnet.ip_version == 4:
|
if subnet.ip_version == 4:
|
||||||
host_routes.extend(["%s,0.0.0.0" % (s.cidr) for s in
|
for s in self.network.subnets:
|
||||||
self.network.subnets
|
sub_segment_id = getattr(s, 'segment_id', None)
|
||||||
if (s.ip_version == 4 and
|
if (s.ip_version == 4 and
|
||||||
s.cidr != subnet.cidr and
|
s.cidr != subnet.cidr and
|
||||||
s.segment_id == subnet.segment_id)])
|
sub_segment_id == segment_id):
|
||||||
|
host_routes.append("%s,0.0.0.0" % s.cidr)
|
||||||
|
|
||||||
if host_routes:
|
if host_routes:
|
||||||
if gateway:
|
if gateway:
|
||||||
|
@ -385,7 +385,6 @@ class FakeV4Subnet(Dictable):
|
|||||||
self.enable_dhcp = True
|
self.enable_dhcp = True
|
||||||
self.host_routes = [FakeV4HostRoute()]
|
self.host_routes = [FakeV4HostRoute()]
|
||||||
self.dns_nameservers = ['8.8.8.8']
|
self.dns_nameservers = ['8.8.8.8']
|
||||||
self.segment_id = None
|
|
||||||
|
|
||||||
|
|
||||||
class FakeV4Subnet2(FakeV4Subnet):
|
class FakeV4Subnet2(FakeV4Subnet):
|
||||||
@ -499,7 +498,6 @@ class FakeV4SubnetNoDHCP(object):
|
|||||||
self.enable_dhcp = False
|
self.enable_dhcp = False
|
||||||
self.host_routes = []
|
self.host_routes = []
|
||||||
self.dns_nameservers = []
|
self.dns_nameservers = []
|
||||||
self.segment_id = None
|
|
||||||
|
|
||||||
|
|
||||||
class FakeV6SubnetDHCPStateful(Dictable):
|
class FakeV6SubnetDHCPStateful(Dictable):
|
||||||
|
Loading…
Reference in New Issue
Block a user