mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-05 23:53:26 +00:00
zebra: Prevent crash in the off-chance we make a mistake
Prevent zebra from crashing for when the nexthop vrf has changed in some manner and the lookup fails. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
049e899eb2
commit
4c66767c10
@ -1108,7 +1108,10 @@ static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn,
|
||||
struct vrf *vrf =
|
||||
vrf_lookup_by_id(nexthop->vrf_id);
|
||||
|
||||
vty_out(vty, "(vrf %s)", vrf->name);
|
||||
if (vrf)
|
||||
vty_out(vty, "(vrf %s)", vrf->name);
|
||||
else
|
||||
vty_out(vty, "(vrf UKNOWN)");
|
||||
}
|
||||
|
||||
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE))
|
||||
@ -1468,7 +1471,10 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
|
||||
if (nexthop->vrf_id != re->vrf_id) {
|
||||
struct vrf *vrf = vrf_lookup_by_id(nexthop->vrf_id);
|
||||
|
||||
vty_out(vty, "(vrf %s)", vrf->name);
|
||||
if (vrf)
|
||||
vty_out(vty, "(vrf %s)", vrf->name);
|
||||
else
|
||||
vty_out(vty, "(vrf UKNOWN)");
|
||||
}
|
||||
|
||||
if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user