diff options
| author | Mark Stapp <mjs.ietf@gmail.com> | 2025-03-11 14:03:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-11 14:03:14 -0400 |
| commit | d0cb3ad7cb3ce5ac25c159e43f2cb1ccde2e2e14 (patch) | |
| tree | e1c744749d75ef96339fb04c15be9dcf829af3a3 /zebra/zebra_rib.c | |
| parent | b1711c010fbb016b982b1d7471ae62a44c00e93c (diff) | |
| parent | c50fe2104567358fd6ce5d9cbec624fa0490c1af (diff) | |
Merge pull request #16614 from louis-6wind/fix-otable-heap-after-free
zebra: fix table heap-after-free crash
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 8cea605f41..20ec25a431 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -903,6 +903,11 @@ void zebra_rtable_node_cleanup(struct route_table *table, rib_unlink(node, re); } + zebra_node_info_cleanup(node); +} + +void zebra_node_info_cleanup(struct route_node *node) +{ if (node->info) { rib_dest_t *dest = node->info; @@ -4498,6 +4503,12 @@ rib_update_handle_kernel_route_down_possibility(struct route_node *rn, bool alive = false; for (ALL_NEXTHOPS(re->nhe->nhg, nexthop)) { + if (!nexthop->ifindex) { + /* blackhole nexthops have no interfaces */ + alive = true; + break; + } + struct interface *ifp = if_lookup_by_index(nexthop->ifindex, nexthop->vrf_id); |
