diff options
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 0dc8a05e9c..99ddd438ea 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -277,8 +277,7 @@ struct nexthop *route_entry_nexthop_ipv4_ifindex_add(struct route_entry *re, There was a crash because ifp here was coming to be NULL */ if (ifp) if (connected_is_unnumbered(ifp) - || CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE) - || CHECK_FLAG(re->flags, ZEBRA_FLAG_ONLINK)) { + || CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)) { SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK); } @@ -315,10 +314,8 @@ struct nexthop *route_entry_nexthop_ipv6_ifindex_add(struct route_entry *re, nexthop->type = NEXTHOP_TYPE_IPV6_IFINDEX; nexthop->gate.ipv6 = *ipv6; nexthop->ifindex = ifindex; - if (CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE) - || CHECK_FLAG(re->flags, ZEBRA_FLAG_ONLINK)) { + if (CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)) SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK); - } route_entry_nexthop_add(re, nexthop); @@ -457,8 +454,15 @@ static int nexthop_active(afi_t afi, struct route_entry *re, */ if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK)) { ifp = if_lookup_by_index(nexthop->ifindex, nexthop->vrf_id); - if ((ifp && connected_is_unnumbered(ifp)) - || CHECK_FLAG(re->flags, ZEBRA_FLAG_ONLINK)) { + if (!ifp) { + if (IS_ZEBRA_DEBUG_RIB_DETAILED) + zlog_debug( + "\t%s: Onlink and interface: %u[%u] does not exist", + __PRETTY_FUNCTION__, nexthop->ifindex, + nexthop->vrf_id); + return 0; + } + if (connected_is_unnumbered(ifp)) { if (if_is_operative(ifp)) return 1; else { @@ -468,7 +472,8 @@ static int nexthop_active(afi_t afi, struct route_entry *re, __PRETTY_FUNCTION__, ifp->name); return 0; } - } else { + } + if (!if_is_operative(ifp)) { if (IS_ZEBRA_DEBUG_RIB_DETAILED) zlog_debug( "\t%s: Interface %s is not unnumbered", |
