Skip to content

Commit

Permalink
zebra: skip blackhole nexthop when sending multipath netlink updates
Browse files Browse the repository at this point in the history
In case of multipath, when zebra is sending netlink updates to the
kernel, if one of the nexthops is a blackhole zebra tags on unnecessary
bytes at the end of the message.

This is rejected by kernel resulting in zebra marking the route as
rejected. This change fixes that by skipping a blackhole nexthop

Signed-off-by: Abhishek Naik <[email protected]>
  • Loading branch information
bhinin committed Oct 17, 2023
1 parent c8d5684 commit c2bfbbd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2449,6 +2449,8 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx

nexthop_num = 0;
for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx), nexthop)) {
if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE)
continue;
if (CHECK_FLAG(nexthop->flags,
NEXTHOP_FLAG_RECURSIVE)) {
/* This only works for IPv4 now */
Expand Down

0 comments on commit c2bfbbd

Please sign in to comment.