diff options
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 5428b6eaef..f0601012b6 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1046,14 +1046,18 @@ static struct route_entry *rib_choose_best(struct route_entry *current, struct nexthop *nexthop = NULL; for (ALL_NEXTHOPS(alternate->ng, nexthop)) { - if (if_is_loopback_or_vrf(if_lookup_by_index( - nexthop->ifindex, alternate->vrf_id))) + struct interface *ifp = if_lookup_by_index( + nexthop->ifindex, alternate->vrf_id); + + if (ifp && if_is_loopback_or_vrf(ifp)) return alternate; } for (ALL_NEXTHOPS(current->ng, nexthop)) { - if (if_is_loopback_or_vrf(if_lookup_by_index( - nexthop->ifindex, current->vrf_id))) + struct interface *ifp = if_lookup_by_index( + nexthop->ifindex, current->vrf_id); + + if (ifp && if_is_loopback_or_vrf(ifp)) return current; } @@ -1556,7 +1560,9 @@ static bool rib_update_re_from_ctx(struct route_entry *re, changed_p = true; UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB); - break; + + /* Keep checking nexthops */ + continue; } if (CHECK_FLAG(ctx_nexthop->flags, NEXTHOP_FLAG_FIB)) { @@ -1992,6 +1998,9 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx) * not-installed; or not-installed to installed. */ if (start_count > 0 && end_count > 0) { + if (debug_p) + zlog_debug("%u:%s applied nexthop changes from dplane notification", + dplane_ctx_get_vrf(ctx), dest_str); /* Changed nexthops - update kernel/others */ dplane_route_notif_update(rn, re, |
