Skip to content

Commit 10a9a5f

Browse files
donaldsharpmergify[bot]
authored andcommitted
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 6b23ece)
1 parent 31b4c7a commit 10a9a5f

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

zebra/rt_netlink.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,16 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
22962296
tag))
22972297
return 0;
22982298

2299+
/*
2300+
* Add encapsulation information when installing via
2301+
* FPM.
2302+
*/
2303+
if (fpm) {
2304+
if (!netlink_route_nexthop_encap(
2305+
&req->n, datalen, nexthop))
2306+
return 0;
2307+
}
2308+
22992309
if (!setsrc && src1) {
23002310
if (p->family == AF_INET)
23012311
src.ipv4 = src1->ipv4;
@@ -2309,23 +2319,6 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
23092319

23102320
nl_attr_nest_end(&req->n, nest);
23112321

2312-
/*
2313-
* Add encapsulation information when installing via
2314-
* FPM.
2315-
*/
2316-
if (fpm) {
2317-
for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx),
2318-
nexthop)) {
2319-
if (CHECK_FLAG(nexthop->flags,
2320-
NEXTHOP_FLAG_RECURSIVE))
2321-
continue;
2322-
if (!netlink_route_nexthop_encap(
2323-
&req->n, datalen, nexthop))
2324-
return 0;
2325-
}
2326-
}
2327-
2328-
23292322
if (setsrc) {
23302323
if (p->family == AF_INET) {
23312324
if (!nl_attr_put(&req->n, datalen, RTA_PREFSRC,

0 commit comments

Comments
 (0)