diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 7737738d2821..bea31042e874 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2924,7 +2924,7 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp, * is pending (BGP_NODE_FIB_INSTALL_PENDING), do not advertise the * route */ - advertise = bgp_check_advertise(bgp, dest); + advertise = bgp_check_advertise(bgp, dest, safi); if (selected) { if (subgroup_announce_check(dest, selected, subgrp, p, &attr, @@ -2933,7 +2933,7 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp, * in FIB, then it is advertised */ if (advertise) { - if (!bgp_check_withdrawal(bgp, dest)) { + if (!bgp_check_withdrawal(bgp, dest, safi)) { struct attr *adv_attr = bgp_attr_intern(&attr); @@ -7752,7 +7752,7 @@ bool bgp_aggregate_route(struct bgp *bgp, const struct prefix *p, afi_t afi, /* If suppress fib is enabled and route not installed * in FIB, skip the route */ - if (!bgp_check_advertise(bgp, dest)) + if (!bgp_check_advertise(bgp, dest, safi)) continue; match = 0; @@ -8266,7 +8266,7 @@ void bgp_aggregate_increment(struct bgp *bgp, const struct prefix *p, /* If suppress fib is enabled and route not installed * in FIB, do not update the aggregate route */ - if (!bgp_check_advertise(bgp, pi->net)) + if (!bgp_check_advertise(bgp, pi->net, safi)) return; child = bgp_node_get(table, p); diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 9bd9e48e2277..306890202246 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -592,8 +592,12 @@ static inline void prep_for_rmap_apply(struct bgp_path_info *dst_pi, } } -static inline bool bgp_check_advertise(struct bgp *bgp, struct bgp_dest *dest) +static inline bool bgp_check_advertise(struct bgp *bgp, struct bgp_dest *dest, + safi_t safi) { + if (!bgp_fibupd_safi(safi)) + return true; + return (!(BGP_SUPPRESS_FIB_ENABLED(bgp) && CHECK_FLAG(dest->flags, BGP_NODE_FIB_INSTALL_PENDING) && (!bgp_option_check(BGP_OPT_NO_FIB)))); @@ -605,11 +609,12 @@ static inline bool bgp_check_advertise(struct bgp *bgp, struct bgp_dest *dest) * This function assumes that bgp_check_advertise was already returned * as good to go. */ -static inline bool bgp_check_withdrawal(struct bgp *bgp, struct bgp_dest *dest) +static inline bool bgp_check_withdrawal(struct bgp *bgp, struct bgp_dest *dest, + safi_t safi) { struct bgp_path_info *pi, *selected = NULL; - if (!BGP_SUPPRESS_FIB_ENABLED(bgp)) + if (!bgp_fibupd_safi(safi) || !BGP_SUPPRESS_FIB_ENABLED(bgp)) return false; for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) { diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 33617811cfe8..b412fa6b2071 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -307,6 +307,7 @@ static void subgroup_coalesce_timer(struct event *thread) { struct update_subgroup *subgrp; struct bgp *bgp; + safi_t safi; subgrp = EVENT_ARG(thread); if (bgp_debug_update(NULL, NULL, subgrp->update_group, 0)) @@ -317,7 +318,7 @@ static void subgroup_coalesce_timer(struct event *thread) subgrp->v_coalesce = 0; bgp = SUBGRP_INST(subgrp); subgroup_announce_route(subgrp); - + safi = SUBGRP_SAFI(subgrp); /* While the announce_route() may kick off the route advertisement timer * for @@ -328,7 +329,8 @@ static void subgroup_coalesce_timer(struct event *thread) * announce, this is the method currently employed to trigger the EOR. */ if (!bgp_update_delay_active(SUBGRP_INST(subgrp)) && - !(BGP_SUPPRESS_FIB_ENABLED(bgp))) { + !(bgp_fibupd_safi(safi) && BGP_SUPPRESS_FIB_ENABLED(bgp))) { + struct peer_af *paf; struct peer *peer; @@ -549,7 +551,8 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, * the flag PEER_STATUS_ADV_DELAY which will allow * more routes to be sent in the update message */ - if (BGP_SUPPRESS_FIB_ENABLED(bgp)) { + if (bgp_fibupd_safi(safi) && + BGP_SUPPRESS_FIB_ENABLED(bgp)) { adv_peer = PAF_PEER(paf); if (!bgp_adv_fifo_count( &subgrp->sync->withdraw)) @@ -1014,7 +1017,7 @@ void group_announce_route(struct bgp *bgp, afi_t afi, safi_t safi, /* If suppress fib is enabled, the route will be advertised when * FIB status is received */ - if (!bgp_check_advertise(bgp, dest)) + if (!bgp_check_advertise(bgp, dest, safi)) return; update_group_af_walk(bgp, afi, safi, group_announce_route_walkcb, &ctx);