Merge "Point DHCP gateway to default gateway"

This commit is contained in:
Jenkins 2016-05-16 10:56:09 +00:00 committed by Gerrit Code Review
commit 53c5a00f86

View File

@ -400,8 +400,14 @@ interface first.")
elif key == "ADMIN_NETWORK/dhcp_pool_end":
self.edits[index].set_edit_text(dynamic_end)
elif key == "ADMIN_NETWORK/dhcp_gateway":
self.edits[index].set_edit_text(self.netsettings[
self.activeiface]['addr'])
gw = self.get_default_gateway_linux()
if network.inSameSubnet(
gw, dynamic_start,
self.netsettings[self.activeiface]['netmask']):
dhcp_gateway = gw
else:
dhcp_gateway = self.netsettings[self.activeiface]['addr']
self.edits[index].set_edit_text(dhcp_gateway)
def refresh(self):
self.getNetwork()