Skip to content

Commit

Permalink
Merge pull request #15363 from FRRouting/mergify/bp/stable/9.0/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 committed Feb 13, 2024
2 parents 9322d29 + 7b1e5a9 commit b914e4a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zebra/zebra_nhg.c
Expand Up @@ -2398,10 +2398,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 b914e4a

Please sign in to comment.