From f857321ea9dc42721c9a274db68e8407ad6418d5 Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Mon, 25 Apr 2016 20:19:08 +0000 Subject: [PATCH] BGP peers remain in active while rdnbrd is running. Signed-off-by: Daniel Walton Reviewed-by: Donald Sharp Ticket: CM-7789, CM-8806 If the route-map for an "ip import-table" denied a route it only flagged the nexthop as inactive, it did not actually delete the route. This breaks all directly connected EBGP peers that peer via IPv4 because NHT finds this /32 with an inactive nexthop. --- zebra/zebra_rib.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 0c7dd57911..1cd28d75ca 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1347,10 +1347,28 @@ rib_process (struct route_node *rn) * recursive NHs. */ if (!CHECK_FLAG(rib->flags, ZEBRA_FLAG_CHANGED) && - ! nexthop_active_update (rn, rib, 0)) - continue; + ! nexthop_active_update (rn, rib, 0)) + { + if (rib->type == ZEBRA_ROUTE_TABLE) + { + /* This entry was denied by the 'ip protocol table' route-map, we + * need to delete it */ + if (rib != fib) + { + if (IS_ZEBRA_DEBUG_RIB) + zlog_debug ("%s: %s/%d: imported via import-table but denied " + "by the ip protocol table route-map", + __func__, buf, rn->p.prefixlen); + rib_unlink (rn, rib); + } + else + del = rib; + } + + continue; + } - /* Infinit distance. */ + /* Infinite distance. */ if (rib->distance == DISTANCE_INFINITY) { UNSET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); -- 2.39.5