diff options
author | Madhuri Kuruganti <maduri111@gmail.com> | 2022-09-21 09:03:52 +0200 |
---|---|---|
committer | Madhuri Kuruganti <maduri111@gmail.com> | 2022-10-06 08:47:27 +0200 |
commit | 8093d7999ca7ba3b8c60217544ae977698128b01 (patch) | |
tree | fb9208bf8fd15f5fdd6c97952f102edae204afef /bgpd/bgp_conditional_adv.c | |
parent | Merge pull request #12060 from donaldsharp/tunnel_shenanigans (diff) | |
download | frr-8093d7999ca7ba3b8c60217544ae977698128b01.tar.xz frr-8093d7999ca7ba3b8c60217544ae977698128b01.zip |
bgpd: adding debug command for conditional advertisement
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
Diffstat (limited to 'bgpd/bgp_conditional_adv.c')
-rw-r--r-- | bgpd/bgp_conditional_adv.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c index fc44e86cb..55e252519 100644 --- a/bgpd/bgp_conditional_adv.c +++ b/bgpd/bgp_conditional_adv.c @@ -53,18 +53,16 @@ bgp_check_rmap_prefixes_in_bgp_table(struct bgp_table *table, if (ret == RMAP_PERMITMATCH) { bgp_dest_unlock_node(dest); - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug( - "%s: Condition map routes present in BGP table", - __func__); + bgp_cond_adv_debug( + "%s: Condition map routes present in BGP table", + __func__); return ret; } } } - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug("%s: Condition map routes not present in BGP table", + bgp_cond_adv_debug("%s: Condition map routes not present in BGP table", __func__); return ret; @@ -98,8 +96,7 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi, subgrp->pscount = 0; SET_FLAG(subgrp->sflags, SUBGRP_STATUS_TABLE_REPARSING); - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug("%s: %s routes to/from %s for %s", __func__, + bgp_cond_adv_debug("%s: %s routes to/from %s for %s", __func__, update_type == UPDATE_TYPE_ADVERTISE ? "Advertise" : "Withdraw", peer->host, get_afi_safi_str(afi, safi, false)); @@ -224,7 +221,7 @@ static void bgp_conditional_adv_timer(struct thread *t) && !peer->advmap_table_change) continue; - if (BGP_DEBUG(update, UPDATE_OUT)) { + if (BGP_DEBUG(cond_adv, COND_ADV)) { if (peer->advmap_table_change) zlog_debug( "%s: %s - routes changed in BGP table.", @@ -269,10 +266,9 @@ static void bgp_conditional_adv_timer(struct thread *t) .advmap.update_type != filter->advmap.update_type)) { /* Handle change to peer advmap */ - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug( - "%s: advmap.update_type changed for peer %s, adjusting update_group.", - __func__, peer->host); + bgp_cond_adv_debug( + "%s: advmap.update_type changed for peer %s, adjusting update_group.", + __func__, peer->host); update_group_adjust_peer(paf); } @@ -283,12 +279,10 @@ static void bgp_conditional_adv_timer(struct thread *t) */ if (peer->advmap_config_change[afi][safi]) { - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug( - "%s: Configuration is changed on peer %s for %s, send the normal update first.", - __func__, peer->host, - get_afi_safi_str(afi, safi, - false)); + bgp_cond_adv_debug( + "%s: Configuration is changed on peer %s for %s, send the normal update first.", + __func__, peer->host, + get_afi_safi_str(afi, safi, false)); if (paf) { update_subgroup_split_peer(paf, NULL); subgrp = paf->subgroup; @@ -325,8 +319,7 @@ void bgp_conditional_adv_enable(struct peer *peer, afi_t afi, safi_t safi) * neighbors (AFI/SAFI). So just increment the counter. */ if (++bgp->condition_filter_count > 1) { - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug("%s: condition_filter_count %d", __func__, + bgp_cond_adv_debug("%s: condition_filter_count %d", __func__, bgp->condition_filter_count); return; @@ -349,8 +342,7 @@ void bgp_conditional_adv_disable(struct peer *peer, afi_t afi, safi_t safi) * So there's nothing to do except decrementing the counter. */ if (--bgp->condition_filter_count != 0) { - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug("%s: condition_filter_count %d", __func__, + bgp_cond_adv_debug("%s: condition_filter_count %d", __func__, bgp->condition_filter_count); return; |