From 19f9e9d30e08143810e39165c52a14b5dfeedc4c Mon Sep 17 00:00:00 2001 From: Niels de Boer Date: Mon, 14 Sep 2026 14:48:19 +0200 Subject: [PATCH] fix: Support multiple routes to the same IPv6 prefix through different gateways learned from router advertisements --- NetworkManager-1.42.4/debian/changelog | 7 ++++ .../src/core/ndisc/nm-ndisc.c | 1 + ndisc-ra-filter.patch | 33 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 ndisc-ra-filter.patch diff --git a/NetworkManager-1.42.4/debian/changelog b/NetworkManager-1.42.4/debian/changelog index f1cf334..417d4c8 100644 --- a/NetworkManager-1.42.4/debian/changelog +++ b/NetworkManager-1.42.4/debian/changelog @@ -1,3 +1,10 @@ +network-manager (1.42.4-1+athom3) bookworm; urgency=medium + + * Support multiple routes to the same IPv6 prefix through different + gateways learned from router advertisements + + -- Niels de Boer Mon, 15 Sep 2026 14:31:16 +0200 + network-manager (1.42.4-1+athom2) bookworm; urgency=medium * Always enable SAE H2E diff --git a/NetworkManager-1.42.4/src/core/ndisc/nm-ndisc.c b/NetworkManager-1.42.4/src/core/ndisc/nm-ndisc.c index 39a4df4..8dc9c63 100644 --- a/NetworkManager-1.42.4/src/core/ndisc/nm-ndisc.c +++ b/NetworkManager-1.42.4/src/core/ndisc/nm-ndisc.c @@ -704,6 +704,7 @@ nm_ndisc_add_route(NMNDisc *ndisc, const NMNDiscRoute *new_item, gint64 now_msec * comparison is aborted, and both routes are added. */ if (IN6_ARE_ADDR_EQUAL(&item->network, &new_item->network) && item->plen == new_item->plen + && IN6_ARE_ADDR_EQUAL(&item->gateway, &new_item->gateway) && item->on_link == new_item->on_link) { if (new_item->expiry_msec <= now_msec) { g_array_remove_index(rdata->routes, i); diff --git a/ndisc-ra-filter.patch b/ndisc-ra-filter.patch new file mode 100644 index 0000000..a384e7f --- /dev/null +++ b/ndisc-ra-filter.patch @@ -0,0 +1,33 @@ +From f766059ea8c4717cdd3b4f65372c1ad233403377 Mon Sep 17 00:00:00 2001 +From: Stefan Agner +Date: Mon, 27 Mar 2023 17:48:34 +0200 +Subject: [PATCH] ndisc: support multiple gateways for a single network + +Also check for gateway equality when deduplicate routing entries. This +allows to support multiple routes to the same network using different +gateways. This is useful for Thread networks where multiple BRs route +to the same Thread network. If one of these BRs go offline, fallback to +a different router will be much quicker if multiple entries are present. + +Note that quick fallback to a different router requires IPv6 +reachability probe to be active. Typically Linux disables reachability +probes on Linux machines which act as IPv6 gateway (when forwarding is +enabled). +--- + src/core/ndisc/nm-ndisc.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c +index ca646a6dad..a7b1adbe23 100644 +--- a/src/core/ndisc/nm-ndisc.c ++++ b/src/core/ndisc/nm-ndisc.c +@@ -703,6 +703,7 @@ nm_ndisc_add_route(NMNDisc *ndisc, const NMNDiscRoute *new_item, gint64 now_msec + * comparison is aborted, and both routes are added. + */ + if (IN6_ARE_ADDR_EQUAL(&item->network, &new_item->network) && item->plen == new_item->plen ++ && IN6_ARE_ADDR_EQUAL(&item->gateway, &new_item->gateway) + && item->on_link == new_item->on_link) { + if (new_item->expiry_msec <= now_msec) { + g_array_remove_index(rdata->routes, i); +-- +GitLab