diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-08-25 12:53:30 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-08-25 13:35:28 +0200 |
commit | 036f482fced6143a5493a8733f58364869d98576 (patch) | |
tree | e38a6d1fcb0e7d9d07ee04a208ad79ba97c921e1 /bgpd | |
parent | bgpd: Convert prefix2str to %pFX (diff) | |
download | frr-036f482fced6143a5493a8733f58364869d98576.tar.xz frr-036f482fced6143a5493a8733f58364869d98576.zip |
bgpd: Drop bnc_str() function
Reuse %pFX -> prefix2str()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_nexthop.c | 5 | ||||
-rw-r--r-- | bgpd/bgp_nexthop.h | 1 | ||||
-rw-r--r-- | bgpd/bgp_nht.c | 38 |
3 files changed, 13 insertions, 31 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index d42f2e669..971b1817c 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -64,11 +64,6 @@ int bgp_nexthop_cache_compare(const struct bgp_nexthop_cache *a, return prefix_cmp(&a->prefix, &b->prefix); } -const char *bnc_str(struct bgp_nexthop_cache *bnc, char *buf, int size) -{ - return prefix2str(&bnc->prefix, buf, size); -} - void bnc_nexthop_free(struct bgp_nexthop_cache *bnc) { nexthops_free(bnc->nexthop); diff --git a/bgpd/bgp_nexthop.h b/bgpd/bgp_nexthop.h index 9d653ef4d..efad906d0 100644 --- a/bgpd/bgp_nexthop.h +++ b/bgpd/bgp_nexthop.h @@ -161,7 +161,6 @@ extern struct bgp_nexthop_cache *bnc_find(struct bgp_nexthop_cache_head *tree, uint32_t srte_color, ifindex_t ifindex); extern void bnc_nexthop_free(struct bgp_nexthop_cache *bnc); -extern const char *bnc_str(struct bgp_nexthop_cache *bnc, char *buf, int size); extern void bgp_scan_init(struct bgp *bgp); extern void bgp_scan_finish(struct bgp *bgp); extern void bgp_scan_vty_init(void); diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index b7964aa7a..61f1b295c 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -82,13 +82,10 @@ static int bgp_isvalid_labeled_nexthop(struct bgp_nexthop_cache *bnc) static void bgp_unlink_nexthop_check(struct bgp_nexthop_cache *bnc) { if (LIST_EMPTY(&(bnc->paths)) && !bnc->nht_info) { - if (BGP_DEBUG(nht, NHT)) { - char buf[PREFIX2STR_BUFFER]; - zlog_debug("%s: freeing bnc %s(%d)(%u)(%s)", __func__, - bnc_str(bnc, buf, PREFIX2STR_BUFFER), - bnc->ifindex, bnc->srte_color, + if (BGP_DEBUG(nht, NHT)) + zlog_debug("%s: freeing bnc %pFX(%d)(%u)(%s)", __func__, + &bnc->prefix, bnc->ifindex, bnc->srte_color, bnc->bgp->name_pretty); - } /* only unregister if this is the last nh for this prefix*/ if (!bnc_existing_for_prefix(bnc)) unregister_zebra_rnh(bnc); @@ -261,24 +258,17 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, if (!bnc) { bnc = bnc_new(tree, &p, srte_color, ifindex); bnc->bgp = bgp_nexthop; - if (BGP_DEBUG(nht, NHT)) { - char buf[PREFIX2STR_BUFFER]; - - zlog_debug("Allocated bnc %s(%d)(%u)(%s) peer %p", - bnc_str(bnc, buf, PREFIX2STR_BUFFER), - bnc->ifindex, bnc->srte_color, + if (BGP_DEBUG(nht, NHT)) + zlog_debug("Allocated bnc %pFX(%d)(%u)(%s) peer %p", + &bnc->prefix, bnc->ifindex, bnc->srte_color, bnc->bgp->name_pretty, peer); - } } else { - if (BGP_DEBUG(nht, NHT)) { - char buf[PREFIX2STR_BUFFER]; - + if (BGP_DEBUG(nht, NHT)) zlog_debug( - "Found existing bnc %s(%d)(%s) flags 0x%x ifindex %d #paths %d peer %p", - bnc_str(bnc, buf, PREFIX2STR_BUFFER), - bnc->ifindex, bnc->bgp->name_pretty, bnc->flags, - bnc->ifindex, bnc->path_count, bnc->nht_info); - } + "Found existing bnc %pFX(%d)(%s) flags 0x%x ifindex %d #paths %d peer %p", + &bnc->prefix, bnc->ifindex, + bnc->bgp->name_pretty, bnc->flags, bnc->ifindex, + bnc->path_count, bnc->nht_info); } if (pi && is_route_parent_evpn(pi)) @@ -1019,14 +1009,12 @@ void evaluate_paths(struct bgp_nexthop_cache *bnc) const struct prefix *p; if (BGP_DEBUG(nht, NHT)) { - char buf[PREFIX2STR_BUFFER]; char bnc_buf[BNC_FLAG_DUMP_SIZE]; char chg_buf[BNC_FLAG_DUMP_SIZE]; - bnc_str(bnc, buf, PREFIX2STR_BUFFER); zlog_debug( - "NH update for %s(%d)(%u)(%s) - flags %s chgflags %s- evaluate paths", - buf, bnc->ifindex, bnc->srte_color, + "NH update for %pFX(%d)(%u)(%s) - flags %s chgflags %s- evaluate paths", + &bnc->prefix, bnc->ifindex, bnc->srte_color, bnc->bgp->name_pretty, bgp_nexthop_dump_bnc_flags(bnc, bnc_buf, sizeof(bnc_buf)), |