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

This commit is contained in:
mssonicbld 2023-12-01 20:42:12 +08:00 committed by GitHub
parent 56eeb471da
commit a225a29ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch
0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch 0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch
0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch 0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch
0032-zebra-Fix-fpm-multipath-encap-addition.patch