summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_mpath.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-03-22 05:02:18 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-03-26 21:25:16 +0100
commitb54892e0ea247f52beea96855734919f80de5217 (patch)
treeb76b8a7899121ff14334dd7773d335b8b8b705d2 /bgpd/bgp_mpath.c
parentlib, bgpd: Another round of `struct const prefix` cleanup (diff)
downloadfrr-b54892e0ea247f52beea96855734919f80de5217.tar.xz
frr-b54892e0ea247f52beea96855734919f80de5217.zip
bgpd: Convert users of `rn->p` to use accessor function
Add new function `bgp_node_get_prefix()` and modify the bgp code base to use it. This is prep work for the struct bgp_dest rework. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_mpath.c')
-rw-r--r--bgpd/bgp_mpath.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 7ec33556c..cbef41baf 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -447,7 +447,7 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
struct listnode *mp_node, *mp_next_node;
struct bgp_path_info *cur_mpath, *new_mpath, *next_mpath, *prev_mpath;
int mpath_changed, debug;
- char pfx_buf[PREFIX2STR_BUFFER], nh_buf[2][INET6_ADDRSTRLEN];
+ char nh_buf[2][INET6_ADDRSTRLEN];
char path_buf[PATH_ADDPATH_STR_BUFFER];
mpath_changed = 0;
@@ -459,9 +459,6 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
mp_node = listhead(mp_list);
debug = bgp_debug_bestpath(rn);
- if (debug)
- prefix2str(&rn->p, pfx_buf, sizeof(pfx_buf));
-
if (new_best) {
mpath_count++;
if (new_best != old_best)
@@ -480,8 +477,8 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
if (debug)
zlog_debug(
- "%s: starting mpath update, newbest %s num candidates %d old-mpath-count %d",
- pfx_buf, new_best ? new_best->peer->host : "NONE",
+ "%pRN: starting mpath update, newbest %s num candidates %d old-mpath-count %d",
+ rn, new_best ? new_best->peer->host : "NONE",
mp_list ? listcount(mp_list) : 0, old_mpath_count);
/*
@@ -513,8 +510,8 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
if (debug)
zlog_debug(
- "%s: comparing candidate %s with existing mpath %s",
- pfx_buf,
+ "%pRN: comparing candidate %s with existing mpath %s",
+ rn,
tmp_info ? tmp_info->peer->host : "NONE",
cur_mpath ? cur_mpath->peer->host : "NONE");
@@ -537,8 +534,8 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
bgp_path_info_path_with_addpath_rx_str(
cur_mpath, path_buf);
zlog_debug(
- "%s: %s is still multipath, cur count %d",
- pfx_buf, path_buf, mpath_count);
+ "%pRN: %s is still multipath, cur count %d",
+ rn, path_buf, mpath_count);
}
} else {
mpath_changed = 1;
@@ -546,8 +543,8 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
bgp_path_info_path_with_addpath_rx_str(
cur_mpath, path_buf);
zlog_debug(
- "%s: remove mpath %s nexthop %s, cur count %d",
- pfx_buf, path_buf,
+ "%pRN: remove mpath %s nexthop %s, cur count %d",
+ rn, path_buf,
inet_ntop(AF_INET,
&cur_mpath->attr
->nexthop,
@@ -579,8 +576,8 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
bgp_path_info_path_with_addpath_rx_str(
cur_mpath, path_buf);
zlog_debug(
- "%s: remove mpath %s nexthop %s, cur count %d",
- pfx_buf, path_buf,
+ "%pRN: remove mpath %s nexthop %s, cur count %d",
+ rn, path_buf,
inet_ntop(AF_INET,
&cur_mpath->attr->nexthop,
nh_buf[0], sizeof(nh_buf[0])),
@@ -624,8 +621,8 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
bgp_path_info_path_with_addpath_rx_str(
new_mpath, path_buf);
zlog_debug(
- "%s: add mpath %s nexthop %s, cur count %d",
- pfx_buf, path_buf,
+ "%pRN: add mpath %s nexthop %s, cur count %d",
+ rn, path_buf,
inet_ntop(AF_INET,
&new_mpath->attr
->nexthop,
@@ -641,8 +638,8 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
if (new_best) {
if (debug)
zlog_debug(
- "%s: New mpath count (incl newbest) %d mpath-change %s",
- pfx_buf, mpath_count,
+ "%pRN: New mpath count (incl newbest) %d mpath-change %s",
+ rn, mpath_count,
mpath_changed ? "YES" : "NO");
bgp_path_info_mpath_count_set(new_best, mpath_count - 1);