From: Donatas Abraitis Date: Thu, 25 Jul 2024 10:41:23 +0000 (+0300) Subject: bgpd: Do not increment treat-as-withdraw counters if debug is enabled X-Git-Tag: base_10.2~239^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F16471%2Fhead;p=mirror%2Ffrr.git bgpd: Do not increment treat-as-withdraw counters if debug is enabled Increment only if we really treat the UPDATE as withdrawn. Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 0fb59a94c2..842fd1734a 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -2390,13 +2390,13 @@ static int bgp_update_receive(struct peer_connection *connection, ret = bgp_dump_attr(&attr, peer->rcvd_attr_str, sizeof(peer->rcvd_attr_str)); - peer->stat_upd_7606++; - - if (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW) + if (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW) { + peer->stat_upd_7606++; flog_err( EC_BGP_UPDATE_RCV, "%pBP rcvd UPDATE with errors in attr(s)!! Withdrawing route.", peer); + } if (ret && bgp_debug_update(peer, NULL, NULL, 1) && BGP_DEBUG(update, UPDATE_DETAIL)) {