Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: Fix fpm multipath encap addition (backport #14835) #14842

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2473,6 +2473,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;
Expand All @@ -2486,23 +2496,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,
Expand Down
Loading