Skip to content

Commit

Permalink
Merge pull request #15364 from FRRouting/mergify/bp/stable/8.5/pr-14080
Browse files Browse the repository at this point in the history
zebra: fix nhg out of sync between zebra and kernel (backport #14080)
  • Loading branch information
ton31337 authored Feb 13, 2024
2 parents e5678a7 + 8db6e5b commit b37e00c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zebra/zebra_nhg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,10 +2365,13 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
nexthop->ifindex);

newhop = match->nhe->nhg.nexthop;
if (nexthop->type == NEXTHOP_TYPE_IPV4 ||
nexthop->type == NEXTHOP_TYPE_IPV6)
if (nexthop->type == NEXTHOP_TYPE_IPV4) {
nexthop->ifindex = newhop->ifindex;
else if (nexthop->ifindex != newhop->ifindex) {
nexthop->type = NEXTHOP_TYPE_IPV4_IFINDEX;
} else if (nexthop->type == NEXTHOP_TYPE_IPV6) {
nexthop->ifindex = newhop->ifindex;
nexthop->type = NEXTHOP_TYPE_IPV6_IFINDEX;
} else if (nexthop->ifindex != newhop->ifindex) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug(
"%s: %pNHv given ifindex does not match nexthops ifindex found: %pNHv",
Expand Down

0 comments on commit b37e00c

Please sign in to comment.