From: Donald Sharp Date: Thu, 7 Sep 2023 19:14:09 +0000 (-0400) Subject: bgpd: bgp_path_info_cmp should use a bool for debug X-Git-Tag: base_9.1~90^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d16d013ca3d191b4768365934fbb3ebebf3facc3;p=matthieu%2Ffrr.git bgpd: bgp_path_info_cmp should use a bool for debug Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index c8271bf5ce..dadc100706 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -594,7 +594,7 @@ struct bgp_path_info *bgp_get_imported_bpi_ultimate(struct bgp_path_info *info) */ int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new, struct bgp_path_info *exist, int *paths_eq, - struct bgp_maxpaths_cfg *mpath_cfg, int debug, + struct bgp_maxpaths_cfg *mpath_cfg, bool debug, char *pfx_buf, afi_t afi, safi_t safi, enum bgp_path_selection_reason *reason) { @@ -1503,9 +1503,10 @@ int bgp_evpn_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new, { enum bgp_path_selection_reason reason; char pfx_buf[PREFIX2STR_BUFFER] = {}; + bool debug = false; - return bgp_path_info_cmp(bgp, new, exist, paths_eq, NULL, 0, pfx_buf, - AFI_L2VPN, SAFI_EVPN, &reason); + return bgp_path_info_cmp(bgp, new, exist, paths_eq, NULL, debug, + pfx_buf, AFI_L2VPN, SAFI_EVPN, &reason); } /* Compare two bgp route entity. Return -1 if new is preferred, 1 if exist @@ -1519,8 +1520,10 @@ int bgp_path_info_cmp_compatible(struct bgp *bgp, struct bgp_path_info *new, { int paths_eq; int ret; - ret = bgp_path_info_cmp(bgp, new, exist, &paths_eq, NULL, 0, pfx_buf, - afi, safi, reason); + bool debug = false; + + ret = bgp_path_info_cmp(bgp, new, exist, &paths_eq, NULL, debug, + pfx_buf, afi, safi, reason); if (paths_eq) ret = 0; @@ -2708,7 +2711,8 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest, struct bgp_path_info *pi1; struct bgp_path_info *pi2; struct bgp_path_info *nextpi = NULL; - int paths_eq, do_mpath, debug; + int paths_eq, do_mpath; + bool debug; struct list mp_list; char pfx_buf[PREFIX2STR_BUFFER] = {}; char path_buf[PATH_ADDPATH_STR_BUFFER]; diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index e001bf4f07..109711314f 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -914,7 +914,7 @@ extern void bgp_path_info_add_with_caller(const char *caller, extern void bgp_aggregate_free(struct bgp_aggregate *aggregate); extern int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new, struct bgp_path_info *exist, int *paths_eq, - struct bgp_maxpaths_cfg *mpath_cfg, int debug, + struct bgp_maxpaths_cfg *mpath_cfg, bool debug, char *pfx_buf, afi_t afi, safi_t safi, enum bgp_path_selection_reason *reason); #define bgp_path_info_add(A, B) \