diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index a4c56f1bbd6..3e0b25ff3de 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1430,16 +1430,16 @@ static int link_mark_routes(Link *link, bool foreign) { } } } - } - /* Also unmark routes requested in .netdev file. */ - if (foreign && link->netdev && link->netdev->kind == NETDEV_KIND_WIREGUARD) { - Wireguard *w = WIREGUARD(link->netdev); + /* Also unmark routes requested in .netdev file. */ + if (other->netdev && other->netdev->kind == NETDEV_KIND_WIREGUARD) { + Wireguard *w = WIREGUARD(other->netdev); - SET_FOREACH(route, w->routes) { - r = link_unmark_route(link, route, NULL); - if (r < 0) - return r; + SET_FOREACH(route, w->routes) { + r = link_unmark_route(other, route, NULL); + if (r < 0) + return r; + } } } diff --git a/test/test-network/conf/25-route-static.network b/test/test-network/conf/25-route-static.network index 7ef211d4109..5ddd7de61a5 100644 --- a/test/test-network/conf/25-route-static.network +++ b/test/test-network/conf/25-route-static.network @@ -96,7 +96,7 @@ MultiPathRoute=149.10.124.59 10 MultiPathRoute=149.10.124.60 5 [Route] -Destination=2001:1234:5:7fff:ff:ff:ff:ff/128 +Destination=2001:1234:5:bfff:ff:ff:ff:ff/128 MultiPathRoute=2001:1234:5:6fff:ff:ff:ff:ff@test1 20 MultiPathRoute=2001:1234:5:7fff:ff:ff:ff:ff@test1 30 MultiPathRoute=2001:1234:5:8fff:ff:ff:ff:ff@dummy98 10 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 6e7ce7cbd8b..6b1633a9614 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -3445,11 +3445,11 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertIn('dev dummy98 weight 10', output) self.assertIn('dev dummy98 weight 5', output) - print('### ip -6 route show 2001:1234:5:7fff:ff:ff:ff:ff') - output = check_output('ip -6 route show 2001:1234:5:7fff:ff:ff:ff:ff') + print('### ip -6 route show 2001:1234:5:bfff:ff:ff:ff:ff') + output = check_output('ip -6 route show 2001:1234:5:bfff:ff:ff:ff:ff') print(output) # old ip command does not show 'nexthop' keyword and weight... - self.assertIn('2001:1234:5:7fff:ff:ff:ff:ff', output) + self.assertIn('2001:1234:5:bfff:ff:ff:ff:ff', output) self.assertIn('via 2001:1234:5:6fff:ff:ff:ff:ff dev test1', output) self.assertIn('via 2001:1234:5:7fff:ff:ff:ff:ff dev test1', output) self.assertIn('via 2001:1234:5:8fff:ff:ff:ff:ff dev dummy98', output)