diff options
| -rw-r--r-- | bgpd/bgp_route.c | 38 | ||||
| -rw-r--r-- | bgpd/bgpd.c | 11 |
2 files changed, 12 insertions, 37 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 8626658149..ed3b75f87c 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -38,6 +38,7 @@ #include "queue.h" #include "memory.h" #include "lib/json.h" +#include "lib_errors.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_table.h" @@ -353,12 +354,9 @@ static void bgp_pcount_adjust(struct bgp_node *rn, struct bgp_info *ri) /* slight hack, but more robust against errors. */ if (ri->peer->pcount[table->afi][table->safi]) ri->peer->pcount[table->afi][table->safi]--; - else { - zlog_warn( - "%s: Asked to decrement 0 prefix count for peer %s", - __func__, ri->peer->host); - zlog_backtrace(LOG_WARNING); - } + else + flog_err(LIB_ERR_DEVELOPMENT, + "Asked to decrement 0 prefix count for peer"); } else if (BGP_INFO_COUNTABLE(ri) && !CHECK_FLAG(ri->flags, BGP_INFO_COUNTED)) { SET_FLAG(ri->flags, BGP_INFO_COUNTED); @@ -1052,8 +1050,8 @@ static enum filter_type bgp_input_filter(struct peer *peer, struct prefix *p, #define FILTER_EXIST_WARN(F, f, filter) \ if (BGP_DEBUG(update, UPDATE_IN) && !(F##_IN(filter))) \ - zlog_warn("%s: Could not find configured input %s-list %s!", \ - peer->host, #f, F##_IN_NAME(filter)); + zlog_debug("%s: Could not find configured input %s-list %s!", \ + peer->host, #f, F##_IN_NAME(filter)); if (DISTRIBUTE_IN_NAME(filter)) { FILTER_EXIST_WARN(DISTRIBUTE, distribute, filter); @@ -1091,8 +1089,8 @@ static enum filter_type bgp_output_filter(struct peer *peer, struct prefix *p, #define FILTER_EXIST_WARN(F, f, filter) \ if (BGP_DEBUG(update, UPDATE_OUT) && !(F##_OUT(filter))) \ - zlog_warn("%s: Could not find configured output %s-list %s!", \ - peer->host, #f, F##_OUT_NAME(filter)); + zlog_debug("%s: Could not find configured output %s-list %s!", \ + peer->host, #f, F##_OUT_NAME(filter)); if (DISTRIBUTE_OUT_NAME(filter)) { FILTER_EXIST_WARN(DISTRIBUTE, distribute, filter); @@ -9807,8 +9805,6 @@ static int bgp_peer_count_walker(struct thread *t) pc->count[PCOUNT_ADJ_IN]++; for (ri = rn->info; ri; ri = ri->next) { - char buf[SU_ADDRSTRLEN]; - if (ri->peer != peer) continue; @@ -9830,22 +9826,12 @@ static int bgp_peer_count_walker(struct thread *t) if (CHECK_FLAG(ri->flags, BGP_INFO_COUNTED)) { pc->count[PCOUNT_COUNTED]++; if (CHECK_FLAG(ri->flags, BGP_INFO_UNUSEABLE)) - zlog_warn( - "%s [pcount] %s/%d is counted but flags 0x%x", - peer->host, - inet_ntop(rn->p.family, - &rn->p.u.prefix, buf, - SU_ADDRSTRLEN), - rn->p.prefixlen, ri->flags); + flog_err(LIB_ERR_DEVELOPMENT, + "Attempting to count but flags say it is unusable"); } else { if (!CHECK_FLAG(ri->flags, BGP_INFO_UNUSEABLE)) - zlog_warn( - "%s [pcount] %s/%d not counted but flags 0x%x", - peer->host, - inet_ntop(rn->p.family, - &rn->p.u.prefix, buf, - SU_ADDRSTRLEN), - rn->p.prefixlen, ri->flags); + flog_err(LIB_ERR_DEVELOPMENT, + "Not counted but flags say we should"); } } } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index c8b4e3acf5..746967a3b3 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -6631,17 +6631,6 @@ char *peer_uptime(time_t uptime2, char *buf, size_t len, uint8_t use_json, time_t uptime1, epoch_tbuf; struct tm *tm; - /* Check buffer length. */ - if (len < BGP_UPTIME_LEN) { - if (!use_json) { - zlog_warn("peer_uptime (): buffer shortage %lu", - (unsigned long)len); - /* XXX: should return status instead of buf... */ - snprintf(buf, len, "<error> "); - } - return buf; - } - /* If there is no connection has been done before print `never'. */ if (uptime2 == 0) { if (use_json) { |
