From e0207895f72e11dbf541db29fc02aeb43d95a5c6 Mon Sep 17 00:00:00 2001 From: "G. Paul Ziemba" Date: Mon, 19 Feb 2018 14:55:30 -0800 Subject: [PATCH] bgpd: some more debug info when 'debug updates out' is set Signed-off-by: G. Paul Ziemba --- bgpd/bgp_route.c | 7 +++++++ bgpd/bgp_updgrp_adv.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 2dab3ce6a9..35e9faf3ff 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -1966,6 +1966,13 @@ int subgroup_process_announce_selected(struct update_subgroup *subgrp, onlypeer = ((SUBGRP_PCOUNT(subgrp) == 1) ? (SUBGRP_PFIRST(subgrp))->peer : NULL); + if (BGP_DEBUG(update, UPDATE_OUT)) { + char buf_prefix[PREFIX_STRLEN]; + prefix2str(p, buf_prefix, sizeof(buf_prefix)); + zlog_debug("%s: p=%s, selected=%p", + __func__, buf_prefix, selected); + } + /* First update is deferred until ORF or ROUTE-REFRESH is received */ if (onlypeer && CHECK_FLAG(onlypeer->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH)) diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 705cb152f0..e66e5a540b 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -113,6 +113,14 @@ static int group_announce_route_walkcb(struct update_group *updgrp, void *arg) peer = UPDGRP_PEER(updgrp); addpath_capable = bgp_addpath_encode_tx(peer, afi, safi); + if (BGP_DEBUG(update, UPDATE_OUT)) { + char buf_prefix[PREFIX_STRLEN]; + prefix2str(&ctx->rn->p, buf_prefix, sizeof(buf_prefix)); + zlog_debug("%s: afi=%s, safi=%s, p=%s", __func__, afi2str(afi), + safi2str(safi), buf_prefix); + } + + UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) { /* -- 2.39.5