From f146bb54cc9bb8c88399513b701a41806275a470 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Wed, 18 Apr 2018 17:46:49 +0200 Subject: [PATCH] bgpd: add pbr error flag for pbr errors Some errors messages were not guarded. now those log messages are guarded. Signed-off-by: Philippe Guibert --- bgpd/bgp_debug.h | 1 + bgpd/bgp_pbr.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_debug.h b/bgpd/bgp_debug.h index 02712f2a30..d5d8fbb505 100644 --- a/bgpd/bgp_debug.h +++ b/bgpd/bgp_debug.h @@ -126,6 +126,7 @@ struct bgp_debug_filter { #define BGP_DEBUG_FLOWSPEC 0x01 #define BGP_DEBUG_LABELPOOL 0x01 #define BGP_DEBUG_PBR 0x01 +#define BGP_DEBUG_PBR_ERROR 0x02 #define BGP_DEBUG_PACKET_SEND 0x01 #define BGP_DEBUG_PACKET_SEND_DETAIL 0x02 diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index 4813bc0ce5..fe8ba3fbc4 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -227,8 +227,9 @@ static int bgp_pbr_build_and_validate_entry(struct prefix *p, ecom->val + (i * ECOMMUNITY_SIZE); if (action_count > ACTIONS_MAX_NUM) { - zlog_err("%s: flowspec actions exceeds limit (max %u)", - __func__, action_count); + if (BGP_DEBUG(pbr, PBR_ERROR)) + zlog_err("%s: flowspec actions exceeds limit (max %u)", + __func__, action_count); break; } api_action = &api->actions[action_count]; @@ -1035,8 +1036,9 @@ void bgp_pbr_update_entry(struct bgp *bgp, struct prefix *p, api.afi = afi; if (bgp_pbr_build_and_validate_entry(p, info, &api) < 0) { - zlog_err("%s: cancel updating entry in bgp pbr", - __func__); + if (BGP_DEBUG(pbr, PBR_ERROR)) + zlog_err("%s: cancel updating entry in bgp pbr", + __func__); return; } bgp_pbr_handle_entry(bgp, info, &api, nlri_update); -- 2.39.5