[FRR]zebra: Fix fpm multipath encap addition (#17247)

Why I did it
To fix the EVPN type5 failure seen in FRR when there are multipaths for nexthop. The type5 routes were queued

show ip route vrf Vrf1
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF Vrf1:
B>q 5.5.5.0/24 [200/0] via 30.0.0.2, Vlan100 onlink, weight 1, 00:00:40
  q                    via 40.0.0.3, Vlan100 onlink, weight 1, 00:00:40
C>* 10.0.0.0/24 is directly connected, Vlan10, 00:00:43
B>q 100.0.0.0/24 [200/0] via 30.0.0.2, Vlan100 onlink, weight 1, 00:00:40
  q                      via 40.0.0.3, Vlan100 onlink, weight 1, 00:00:40
Work item tracking
Microsoft ADO (number only):
How I did it
Porting the FRR fix FRRouting/frr#14835

How to verify it
Validated EVPN multipath with the scenario and confirmed its working.
This commit is contained in:
Sudharsan Dhamal Gopalarathnam 2023-11-30 22:56:05 -08:00 committed by Ying Xie
parent 15d9177c14
commit 8c782c91a4
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,58 @@
From b7ac2397103fe7d347d0766bd9966ff2302403c5 Mon Sep 17 00:00:00 2001
From: dgsudharsan <sudharsand@nvidia.com>
Date: Tue, 21 Nov 2023 01:17:24 +0000
Subject: [PATCH] zebra: Fix fpm multipath encap addition The fpm code path in
building a ecmp route for evpn has a bug that caused it to not add the encap
attribute to the netlink message. See
#f0f7b285b99dbd971400d33feea007232c0bd4a9 for the single path case being
fixed.
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 71505e037a..6bdc15592c 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -2330,6 +2330,16 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
tag))
return 0;
+ /*
+ * Add encapsulation information when installing via
+ * FPM.
+ */
+ if (fpm) {
+ if (!netlink_route_nexthop_encap(
+ &req->n, datalen, nexthop))
+ return 0;
+ }
+
if (!setsrc && src1) {
if (p->family == AF_INET)
src.ipv4 = src1->ipv4;
@@ -2343,23 +2353,6 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
nl_attr_nest_end(&req->n, nest);
- /*
- * Add encapsulation information when installing via
- * FPM.
- */
- if (fpm) {
- for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx),
- nexthop)) {
- if (CHECK_FLAG(nexthop->flags,
- NEXTHOP_FLAG_RECURSIVE))
- continue;
- if (!netlink_route_nexthop_encap(
- &req->n, datalen, nexthop))
- return 0;
- }
- }
-
-
if (setsrc) {
if (p->family == AF_INET) {
if (!nl_attr_put(&req->n, datalen, RTA_PREFSRC,
--
2.17.1

View File

@ -31,3 +31,4 @@ cross-compile-changes.patch
0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch
0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch
0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch
0032-zebra-Fix-fpm-multipath-encap-addition.patch