ignore bogus default gateway

when a shared network is secondary the default gateway gets overwritten by a bogus one
  dnsmasq does the right thing and replaces it with its own default which is not good for us
  so check for '0.0.0.0'
This commit is contained in:
Daan Hoogland 2017-04-20 09:36:17 +02:00
parent 41b7eee2cb
commit 0db9c980a6

View File

@ -89,9 +89,10 @@ class CsDhcp(CsDataBag):
gateway = gn.get_gateway() gateway = gn.get_gateway()
else: else:
gateway = i['gateway'] gateway = i['gateway']
sline = "dhcp-option=tag:interface-%s-%s,3," % (device, idx) if gateway != '0.0.0.0':
line = "dhcp-option=tag:interface-%s-%s,3,%s" % (device, idx, gateway) sline = "dhcp-option=tag:interface-%s-%s,3," % (device, idx)
self.conf.search(sline, line) line = "dhcp-option=tag:interface-%s-%s,3,%s" % (device, idx, gateway)
self.conf.search(sline, line)
# Netmask # Netmask
netmask = '' netmask = ''
if self.config.is_vpc(): if self.config.is_vpc():