diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-11-17 16:57:20 -0500 | 
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2023-11-21 12:40:07 +0000 | 
| commit | 09f7ab9b3eedb14700866113422591a42ae119aa (patch) | |
| tree | 962efcc95c37a1cac67fd15b66b4ce27e2bb11dd | |
| parent | 4565e5746b6d686ec12a4e0d8a3650557586e69d (diff) | |
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.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 6b23ece88bc061ed6c0bdabf6846e3d981aa757a)
| -rw-r--r-- | zebra/rt_netlink.c | 27 | 
1 files changed, 10 insertions, 17 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index a540687691..2f50e8b8c4 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2389,6 +2389,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; @@ -2402,23 +2412,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,  | 
