summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2026-03-09 12:28:33 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2026-03-09 12:28:33 +0000
commitf8c48dcd81cd20b7567f5fdc27f4aece9ef3480b (patch)
treef3b4c12d5d7339b17a3bba843369a77123127a6b /scripts
parentfbdce6466748fd073c2042a5f92555a935bc44dd (diff)
downloadvyos-build-f8c48dcd81cd20b7567f5fdc27f4aece9ef3480b.tar.gz
vyos-build-f8c48dcd81cd20b7567f5fdc27f4aece9ef3480b.zip
T8363: Ensure FRR does not see duplicate local routes on interface changes
Add zebra patch from upstream
Diffstat (limited to 'scripts')
-rw-r--r--scripts/package-build/frr/patches/frr/0018-zebra-Ensure-FRR-does-not-see-duplicate-local-routes.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/scripts/package-build/frr/patches/frr/0018-zebra-Ensure-FRR-does-not-see-duplicate-local-routes.patch b/scripts/package-build/frr/patches/frr/0018-zebra-Ensure-FRR-does-not-see-duplicate-local-routes.patch
new file mode 100644
index 00000000..f6d033ae
--- /dev/null
+++ b/scripts/package-build/frr/patches/frr/0018-zebra-Ensure-FRR-does-not-see-duplicate-local-routes.patch
@@ -0,0 +1,83 @@
+From bf1312b8e9f65b7e4046760105dce9bace038fad Mon Sep 17 00:00:00 2001
+From: Donald Sharp <sharpd@nvidia.com>
+Date: Thu, 12 Feb 2026 12:06:33 -0500
+Subject: [PATCH] zebra: Ensure FRR does not see duplicate local routes on
+ interface changes
+
+Currently when a interface is seeing multiple link up events in a row,
+we are seeing multiple local routes in the rib:
+
+r9# show ip route vrf all nexthop-group
+% 2026/02/08 23:18:00.371
+
+Codes: K - kernel route, C - connected, L - local, S - static,
+ R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
+ T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
+ F - PBR, f - OpenFabric, t - Table-Direct,
+ > - selected route, * - FIB route, q - queued, r - rejected, b - backup
+ t - trapped, o - offload failure
+
+IPv4 unicast VRF default:
+C>* 11.1.5.0/30 (7) is directly connected, r9-eth0, weight 1, 00:01:52
+L>* 11.1.5.2/32 (7) is directly connected, r9-eth0, weight 1, 00:01:52
+B>* 50.1.1.7/32 [20/0] (10) via 11.1.5.1, r9-eth0, weight 1, 00:01:51
+B>* 50.1.1.8/32 [20/0] (10) via 11.1.5.1, r9-eth0, weight 1, 00:01:51
+L * 50.1.1.9/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+C * 50.1.1.9/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+L>* 50.1.1.9/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+B>* 50.1.1.10/32 [20/0] (10) via 11.1.5.1, r9-eth0, weight 1, 00:01:50
+L * 198.10.1.1/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+C * 198.10.1.1/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+L>* 198.10.1.1/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+B 198.10.1.1/32 [20/0] (10) via 11.1.5.1, r9-eth0, weight 1, 00:01:46
+
+Additionally FRR has made an improper choice about what route should also
+be properly selected, because of this decision. The problem stems from
+rib_compare_routes in zebra_rib.c already handling the multiple same
+connected routes being passed for processing but not for local routes
+to be considered the same. Modify the code to make local routes behave
+the same here. This is the new result:
+
+r9# show ip route vrf all nexthop-group
+% 2026/02/08 23:18:00.371
+
+Codes: K - kernel route, C - connected, L - local, S - static,
+ R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
+ T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
+ F - PBR, f - OpenFabric, t - Table-Direct,
+ > - selected route, * - FIB route, q - queued, r - rejected, b - backup
+ t - trapped, o - offload failure
+
+IPv4 unicast VRF default:
+C>* 11.1.5.0/30 (7) is directly connected, r9-eth0, weight 1, 00:01:52
+L>* 11.1.5.2/32 (7) is directly connected, r9-eth0, weight 1, 00:01:52
+B>* 50.1.1.7/32 [20/0] (10) via 11.1.5.1, r9-eth0, weight 1, 00:01:51
+B>* 50.1.1.8/32 [20/0] (10) via 11.1.5.1, r9-eth0, weight 1, 00:01:51
+C>* 50.1.1.9/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+L>* 50.1.1.9/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+B>* 50.1.1.10/32 [20/0] (10) via 11.1.5.1, r9-eth0, weight 1, 00:01:50
+C>* 198.10.1.1/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+L>* 198.10.1.1/32 (17) is directly connected, r9-eth1, weight 1, 00:01:46
+
+Fixes: #20337
+Signed-off-by: Donald Sharp <sharpd@nvidia.com>
+---
+ zebra/zebra_rib.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
+index dd18262554..f27c50e6fb 100644
+--- a/zebra/zebra_rib.c
++++ b/zebra/zebra_rib.c
+@@ -1647,7 +1647,7 @@ static bool rib_compare_routes(const struct route_entry *re1, const struct route
+ * v6 link-locals, and we also support multiple addresses in the same
+ * subnet on a single interface.
+ */
+- if (re1->type == ZEBRA_ROUTE_CONNECT &&
++ if ((re1->type == ZEBRA_ROUTE_CONNECT || re1->type == ZEBRA_ROUTE_LOCAL) &&
+ (re1->nhe->nhg.nexthop->ifindex == re2->nhe->nhg.nexthop->ifindex))
+ return true;
+
+--
+2.39.5
+