]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix fpm multipath encap addition
authorDonald Sharp <sharpd@nvidia.com>
Fri, 17 Nov 2023 21:57:20 +0000 (16:57 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 21 Nov 2023 12:40:05 +0000 (12:40 +0000)
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)

zebra/rt_netlink.c

index d846918e6c5a6700a01ca140a8a70075287fed43..5d236291433694984b7b05fc201199dda7958efd 100644 (file)
@@ -2296,6 +2296,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;
@@ -2309,23 +2319,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,