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 <sharpd@cumulusnetworks.com>
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);