]> git.ipfire.org Git - thirdparty/systemd.git/commit
network/ndisc: dynamically configure nexthops when routes with gateway are requested 35119/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 11 Nov 2024 17:13:04 +0000 (02:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Nov 2024 02:59:59 +0000 (11:59 +0900)
commit0f8afaf94dd29126981219b3ea2b3bc315cc2dd0
tree3094eaa6626578229cb3eee5abbd841e94b61542
parentae2ffddcfc00aa961fb2567cc804983ea2174a25
network/ndisc: dynamically configure nexthops when routes with gateway are requested

Previously, when multiple routers send RAs with the same preference,
then the kernel merges routes with the same gateway address:
===
default proto ra metric 1024 expires 595sec pref medium
        nexthop via fe80::200:10ff:fe10:1060 dev enp0s9 weight 1
        nexthop via fe80::200:10ff:fe10:1061 dev enp0s9 weight 1
===
This causes IPv6 Conformance Test v6LC.2.2.11 failure, as reported in #33470.

To avoid the coalescing issue, we can use nexthop, as suggested by Ido Schimmel:
https://lore.kernel.org/netdev/ZytjEINNRmtpadr_@shredder/
> BTW, you can avoid the coalescing problem by using the nexthop API.
> # ip nexthop add id 1 via fe80::200:10ff:fe10:1060 dev enp0s9
> # ip -6 route add default nhid 1 expires 600 proto ra
> # ip nexthop add id 2 via fe80::200:10ff:fe10:1061 dev enp0s9
> # ip -6 route append default nhid 2 expires 600 proto ra
> # ip -6 route
> fe80::/64 dev enp0s9 proto kernel metric 256 pref medium
> default nhid 1 via fe80::200:10ff:fe10:1060 dev enp0s9 proto ra metric 1024 expires 563sec pref medium
> default nhid 2 via fe80::200:10ff:fe10:1061 dev enp0s9 proto ra metric 1024 expires 594sec pref medium

Fixes #33470.

Suggested-by: Ido Schimmel <idosch@idosch.org>
src/network/networkd-ndisc.c
test/test-network/systemd-networkd-tests.py