From 0e965c67814e45ae15ca0f6829ed39cbb9251373 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 2 Oct 2019 09:29:19 -0400 Subject: [PATCH] zebra: Fix redistribution deletion for ZEBRA_ROUTE_ALL commit ee8a72f315013aecd45bc9c3aaf7ea81b2ca747a broke the usage of ZEBRA_ROUTE_ALL as a valid redistribution command. This commit puts it back in. LDP uses ZEBRA_ROUTE_ALL as an option to say it is interested in all REDISTRIBUTION events. Fixes: #5072 Signed-off-by: Donald Sharp --- zebra/redistribute.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 227226b5f9..0dc9de0c59 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -263,8 +263,11 @@ void redistribute_delete(const struct prefix *p, const struct prefix *src_p, } /* Add DISTANCE_INFINITY check. */ - if (old_re && (old_re->distance == DISTANCE_INFINITY)) + if (old_re && (old_re->distance == DISTANCE_INFINITY)) { + if (IS_ZEBRA_DEBUG_RIB) + zlog_debug("\tSkipping due to Infinite Distance"); return; + } afi = family2afi(p->family); if (!afi) { @@ -310,14 +313,14 @@ void redistribute_delete(const struct prefix *p, const struct prefix *src_p, /* Send a delete for the 'old' re to any subscribed client. */ if (old_re - && ((old_re->instance - && redist_check_instance( - &client->mi_redist[afi] - [old_re->type], - old_re->instance)) - || vrf_bitmap_check( - client->redist[afi][old_re->type], - old_re->vrf_id))) { + && (vrf_bitmap_check(client->redist[afi][ZEBRA_ROUTE_ALL], + old_re->vrf_id) + || (old_re->instance + && redist_check_instance( + &client->mi_redist[afi][old_re->type], + old_re->instance)) + || vrf_bitmap_check(client->redist[afi][old_re->type], + old_re->vrf_id))) { zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_DEL, client, p, src_p, old_re); } -- 2.39.5