diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-11-21 08:08:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-21 08:08:40 +0100 |
commit | b9228127df3d15928e2bed0fb9b0db92a7081790 (patch) | |
tree | bc442ead8d765cab380214acfa391e5fff53e6dc /zebra | |
parent | Merge pull request #14813 from idryzhov/vtysh-file-lock (diff) | |
parent | zebra: Fix fpm multipath encap addition (diff) | |
download | frr-b9228127df3d15928e2bed0fb9b0db92a7081790.tar.xz frr-b9228127df3d15928e2bed0fb9b0db92a7081790.zip |
Merge pull request #14835 from donaldsharp/multipath_evpn_encap_attr
zebra: Fix fpm multipath encap addition
Diffstat (limited to 'zebra')
-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 3845b21a3..477119d1e 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2475,6 +2475,16 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx 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; @@ -2488,23 +2498,6 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx 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, |