networkd: Routes should take the gateway into account
authorWilliam A. Kennington III <william@wkennington.com>
Fri, 19 Apr 2019 00:52:28 +0000 (17:52 -0700)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 Aug 2019 11:32:36 +0000 (20:32 +0900)
commit0b1cd3e25abccdb1112d71995d1915696a233baf
tree4f8234f4e2194c51313655c757570b5b78dd5b67
parent9f4f7fe3b591093088241dea0e26bcefbd942809
networkd: Routes should take the gateway into account

Otherwise, changing the default gateway doesn't purge old gateway routes
left on the system during daemon restart. This also fixes removing other
foreign gateway routes that don't match the expected configuration.

Tested:
    Changed gateway addresses prior to the patch and they lingered on
    the system during each reconfiguration. Applied this patch and
    reconfigured gateways and other routes multiple times and it removed
    the foreign routes that had gateways that didn't match.

Signed-off-by: William A. Kennington III <william@wkennington.com>
src/network/networkd-dhcp6.c
src/network/networkd-link.c
src/network/networkd-manager.c
src/network/networkd-route.c
src/network/networkd-route.h
test/test-network/conf/25-gateway-next-static.network [new file with mode: 0644]
test/test-network/conf/25-gateway-static.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py