diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-02-24 14:26:59 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-02-28 22:00:25 +0100 |
| commit | b1ff5529c7836ea9006bc89b58b70d300d039d69 (patch) | |
| tree | 909f919e46f828365040c482896bd9ee3839b0b5 | |
| parent | 8cd3d07097a50c3e9282d293928c82c11a15ce60 (diff) | |
bgpd: debug trace retrieve real peer origin of path info
The BGP path info debugging information should dump the
real peer information for imported prefixes.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| -rw-r--r-- | bgpd/bgp_route.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f9028422eb..1e9f9429c5 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -515,11 +515,19 @@ static uint32_t bgp_med_value(struct attr *attr, struct bgp *bgp) void bgp_path_info_path_with_addpath_rx_str(struct bgp_path_info *pi, char *buf, size_t buf_len) { + struct peer *peer; + + if (pi->sub_type == BGP_ROUTE_IMPORTED && + bgp_get_imported_bpi_ultimate(pi)) + peer = bgp_get_imported_bpi_ultimate(pi)->peer; + else + peer = pi->peer; + if (pi->addpath_rx_id) - snprintf(buf, buf_len, "path %s (addpath rxid %d)", - pi->peer->host, pi->addpath_rx_id); + snprintf(buf, buf_len, "path %s (addpath rxid %d)", peer->host, + pi->addpath_rx_id); else - snprintf(buf, buf_len, "path %s", pi->peer->host); + snprintf(buf, buf_len, "path %s", peer->host); } |
