From d9b7fdf06a3fce33d3ae621b83cb2ae7e4996d82 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 21 May 2026 07:34:43 +0900 Subject: [PATCH 1/3] test-network: fix test case for Neighbor Announcement message handling After 9142bd5a8e9ed94ecbb1e335305e24760b90ad2a, when NA without router flag is received, the corresponding redirect route and the default route is removed, but the other routes are kept. The corresponding test case was not updated by the commit, and the test case has been unfortunately skipped... This fixes the test case, and added more checks. --- test/test-network/systemd-networkd-tests.py | 23 ++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 9a8b38a88f..5f5967439d 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -7589,15 +7589,36 @@ class NetworkdRATests(unittest.TestCase, Utilities): timeout_sec=10, ) + print('### before sending NA without router flag') + output = check_output('ip -6 route show dev veth99') + print(output) + self.assertIn('2002:da8:1::/64 proto ra', output) + self.assertIn('2002:da8:2::/64 proto ra', output) + self.assertRegex(output, 'default .* proto ra') + self.assertRegex(output, '2002:da8:1:1:1a:2b:3c:4d .* proto redirect') + self.assertRegex(output, '2002:da8:1:2:1a:2b:3c:4d .* proto redirect') + self.assertIn('2002:da8:1:3:1a:2b:3c:4d proto redirect', output) + # Send Neighbor Advertisement without the router flag to announce the default router is not available # anymore. Then, verify that all redirect routes and the default route are dropped. output = check_output('ip -6 address show dev veth-peer scope link') veth_peer_ipv6ll = re.search('fe80:[:0-9a-f]*', output).group() print(f'veth-peer IPv6LL address: {veth_peer_ipv6ll}') check_output(f'{test_ndisc_send} --interface veth-peer --type neighbor-advertisement --target-address {veth_peer_ipv6ll} --is-router no') # fmt: skip - self.wait_route_dropped('veth99', 'proto ra', ipv='-6', timeout_sec=10) + self.wait_route_dropped('veth99', 'default .* proto ra', ipv='-6', timeout_sec=10) self.wait_route_dropped('veth99', 'proto redirect', ipv='-6', timeout_sec=10) + # Check if the non-default routes are unchanged, and others are actually dropped. + print('### after sending NA without router flag') + output = check_output('ip -6 route show dev veth99') + print(output) + self.assertIn('2002:da8:1::/64 proto ra', output) + self.assertIn('2002:da8:2::/64 proto ra', output) + self.assertNotRegex(output, 'default .* proto ra') + self.assertNotRegex(output, '2002:da8:1:1:1a:2b:3c:4d .* proto redirect') + self.assertNotRegex(output, '2002:da8:1:2:1a:2b:3c:4d .* proto redirect') + self.assertNotIn('2002:da8:1:3:1a:2b:3c:4d proto redirect', output) + # Check if sd-radv refuses RS from the same interface. # See https://github.com/systemd/systemd/pull/32267#discussion_r1566721306 since = datetime.datetime.now() From 2e1cf55dba673751f1c858560e0d8d65c670d4bd Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 21 May 2026 07:47:37 +0900 Subject: [PATCH 2/3] Revert "network: fix max MTU check for IPv6 MTU adjustments" This reverts commit 32417c172383847ec78b672c537594e3efe8f0e0. IPv6 MTU cannot be larger than the current interface MTU. The previous behavior is correct. --- src/network/networkd-sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c index ba90d342c5..c59cb2a5d7 100644 --- a/src/network/networkd-sysctl.c +++ b/src/network/networkd-sysctl.c @@ -545,11 +545,11 @@ int link_set_ipv6_mtu(Link *link, int log_level) { if (mtu == 0) return 0; - if (mtu > link->max_mtu) { + if (mtu > link->mtu) { log_link_full(link, log_level, "Reducing requested IPv6 MTU %"PRIu32" to the interface's maximum MTU %"PRIu32".", - mtu, link->max_mtu); - mtu = link->max_mtu; + mtu, link->mtu); + mtu = link->mtu; } r = sysctl_write_ip_property_uint32(AF_INET6, link->ifname, "mtu", mtu, manager_get_sysctl_shadow(link->manager)); From dece52443cf2dab9fa6cb47a1102086997b6fc4a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 20 May 2026 23:44:49 +0900 Subject: [PATCH 3/3] test-network: fix path to test-ndisc-send Follow-up for 9dcdf16b25545d942b872cc0abdbb7c9a6b5f9f1. Previously, test cases that use test-ndisc-send executable did not tested in our mkosi CIs... --- test/test-network/systemd-networkd-tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 5f5967439d..05c11b6a49 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -11056,7 +11056,7 @@ if __name__ == '__main__': if build_dir: test_ndisc_send = os.path.normpath(os.path.join(build_dir, 'test-ndisc-send')) else: - test_ndisc_send = '/usr/lib/tests/test-ndisc-send' + test_ndisc_send = '/usr/lib/systemd/tests/unit-tests/manual/test-ndisc-send' if build_dir: test_modem_manager_mock = os.path.normpath(os.path.join(build_dir, 'test-modem-manager-mock'))