mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 23:54:45 +00:00
bgpd: Display peer info in NHT output
When a BGP next hop tracking (NHT) entry is created for a peer, display it in the corresponding "show" command output. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
e2d3a90954
commit
5408e68e24
@ -680,17 +680,23 @@ static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp, int detail,
|
|||||||
continue;
|
continue;
|
||||||
for (rn = bgp_table_top(table[afi]); rn;
|
for (rn = bgp_table_top(table[afi]); rn;
|
||||||
rn = bgp_route_next(rn)) {
|
rn = bgp_route_next(rn)) {
|
||||||
|
struct peer *peer;
|
||||||
|
|
||||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||||
if (!bnc)
|
if (!bnc)
|
||||||
continue;
|
continue;
|
||||||
|
peer = (struct peer *)bnc->nht_info;
|
||||||
|
|
||||||
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID)) {
|
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID)) {
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
" %s valid [IGP metric %d], #paths %d\n",
|
" %s valid [IGP metric %d], #paths %d",
|
||||||
inet_ntop(rn->p.family,
|
inet_ntop(rn->p.family,
|
||||||
&rn->p.u.prefix, buf,
|
&rn->p.u.prefix, buf,
|
||||||
sizeof(buf)),
|
sizeof(buf)),
|
||||||
bnc->metric, bnc->path_count);
|
bnc->metric, bnc->path_count);
|
||||||
|
if (peer)
|
||||||
|
vty_out(vty, ", peer %s", peer->host);
|
||||||
|
vty_out(vty, "\n");
|
||||||
|
|
||||||
if (!detail)
|
if (!detail)
|
||||||
continue;
|
continue;
|
||||||
@ -698,10 +704,13 @@ static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp, int detail,
|
|||||||
bgp_show_nexthops_detail(vty, bgp, bnc);
|
bgp_show_nexthops_detail(vty, bgp, bnc);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, " %s invalid\n",
|
vty_out(vty, " %s invalid",
|
||||||
inet_ntop(rn->p.family,
|
inet_ntop(rn->p.family,
|
||||||
&rn->p.u.prefix, buf,
|
&rn->p.u.prefix, buf,
|
||||||
sizeof(buf)));
|
sizeof(buf)));
|
||||||
|
if (peer)
|
||||||
|
vty_out(vty, ", peer %s", peer->host);
|
||||||
|
vty_out(vty, "\n");
|
||||||
if (CHECK_FLAG(bnc->flags,
|
if (CHECK_FLAG(bnc->flags,
|
||||||
BGP_NEXTHOP_CONNECTED))
|
BGP_NEXTHOP_CONNECTED))
|
||||||
vty_out(vty, " Must be Connected\n");
|
vty_out(vty, " Must be Connected\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user