Skip to content

Commit

Permalink
Update zebra_mpls.c
Browse files Browse the repository at this point in the history
update

Signed-off-by: zhou-run <zhou.run@h3c.com>
  • Loading branch information
zhou-run authored Sep 14, 2024
1 parent 873e51a commit f045399
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions zebra/zebra_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,11 @@ static int nhlfe_nexthop_active_ipv4(struct zebra_nhlfe *nhlfe,
for (match_nh = match->nhe->nhg.nexthop; match_nh;
match_nh = match_nh->next) {
if ((match->type == ZEBRA_ROUTE_CONNECT ||
match->type == ZEBRA_ROUTE_LOCAL) &&
nexthop->ifindex == match_nh->ifindex)
match->type == ZEBRA_ROUTE_LOCAL) ||
nexthop->ifindex == match_nh->ifindex) {
nexthop->ifindex = match_nh->ifindex;
return 1;
}
}
}

Expand Down Expand Up @@ -713,16 +715,18 @@ static int nhlfe_nexthop_active_ipv6(struct zebra_nhlfe *nhlfe,

/* Locate a valid connected route. */
RNODE_FOREACH_RE (rn, match) {
if ((match->type == ZEBRA_ROUTE_CONNECT ||
match->type == ZEBRA_ROUTE_LOCAL) &&
if (((match->type == ZEBRA_ROUTE_CONNECT ||
match->type == ZEBRA_ROUTE_LOCAL)) &&
!CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED) &&
CHECK_FLAG(match->flags, ZEBRA_FLAG_SELECTED) &&
match && match->nhe->nhg.nexthop &&
nexthop->ifindex == match->nhe->nhg.nexthop->ifindex)
return 1;
CHECK_FLAG(match->flags, ZEBRA_FLAG_SELECTED))
break;
}

return 0;
if (!match || !match->nhe->nhg.nexthop)
return 0;

nexthop->ifindex = match->nhe->nhg.nexthop->ifindex;
return 1;
}


Expand Down

0 comments on commit f045399

Please sign in to comment.