network: when Gateway=_dhcp4, set several properties based on lease if they are not explicitly specified
Before this commit, event when Gateway=_dhcp4 or _ra is set, the route was configured with 'protocol static', and other properties specified by RouteTable=, RouteMTU=, or etc, were ignored. This commit makes set the route protocol based on the protocol the gateway address is obtained, and apply other settings if it is not explicitly specified in the [Route] section.
This commit is contained in:
@@ -3899,7 +3899,7 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
|
||||
output = check_output('ip route list dev veth99 10.0.0.0/8')
|
||||
print(output)
|
||||
self.assertRegex(output, '10.0.0.0/8 via 192.168.5.1 proto static')
|
||||
self.assertRegex(output, '10.0.0.0/8 via 192.168.5.1 proto dhcp')
|
||||
|
||||
def test_dhcp_client_gateway_ipv6(self):
|
||||
copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network',
|
||||
|
||||
Reference in New Issue
Block a user