mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 06:29:40 +00:00
Merge pull request #5066 from ak503/libfrr_crash
zebra: if_is_loopback_or_vrf crash if if_lookup_by_index return NULL
This commit is contained in:
commit
5c256b572c
@ -1046,14 +1046,18 @@ static struct route_entry *rib_choose_best(struct route_entry *current,
|
|||||||
struct nexthop *nexthop = NULL;
|
struct nexthop *nexthop = NULL;
|
||||||
|
|
||||||
for (ALL_NEXTHOPS(alternate->ng, nexthop)) {
|
for (ALL_NEXTHOPS(alternate->ng, nexthop)) {
|
||||||
if (if_is_loopback_or_vrf(if_lookup_by_index(
|
struct interface *ifp = if_lookup_by_index(
|
||||||
nexthop->ifindex, alternate->vrf_id)))
|
nexthop->ifindex, alternate->vrf_id);
|
||||||
|
|
||||||
|
if (ifp && if_is_loopback_or_vrf(ifp))
|
||||||
return alternate;
|
return alternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ALL_NEXTHOPS(current->ng, nexthop)) {
|
for (ALL_NEXTHOPS(current->ng, nexthop)) {
|
||||||
if (if_is_loopback_or_vrf(if_lookup_by_index(
|
struct interface *ifp = if_lookup_by_index(
|
||||||
nexthop->ifindex, current->vrf_id)))
|
nexthop->ifindex, current->vrf_id);
|
||||||
|
|
||||||
|
if (ifp && if_is_loopback_or_vrf(ifp))
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user