From 2eb07de3d633a4290719798409745a2d55227133 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 29 Jan 2018 17:52:15 -0500 Subject: [PATCH] zebra: Fix crash when dereferencing dest->selected_fib When a rib_unlink() event is directly called for a route_entry we need to see if the dest->selected_fib is the same and just unset the dest->selected_fib. This was happening for redistributed table 10 routes into BGP. Signed-off-by: Donald Sharp --- zebra/zebra_rib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c200e2dbb3..b7b4a159da 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2098,6 +2098,9 @@ void rib_unlink(struct route_node *rn, struct route_entry *re) dest->routes = re->next; } + if (dest->selected_fib == re) + dest->selected_fib = NULL; + /* free RE and nexthops */ zebra_deregister_rnh_static_nexthops(re->vrf_id, re->nexthop, rn); nexthops_free(re->nexthop); -- 2.39.5