summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nexthop.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2019-08-19 07:21:38 +0200
committervivek <vivek@cumulusnetworks.com>2019-08-19 07:21:38 +0200
commit5408e68e24e144687f9e00911addf6a80ccc2f50 (patch)
treeffa279acb7db7a39827e8b01fdacffdaea6b8f8f /bgpd/bgp_nexthop.c
parentbgpd: Fix nexthop reg for IPv4 route exchange using GUA IPv6 peering (diff)
downloadfrr-5408e68e24e144687f9e00911addf6a80ccc2f50.tar.xz
frr-5408e68e24e144687f9e00911addf6a80ccc2f50.zip
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>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_nexthop.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index a8c507832..812f0ce16 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -680,17 +680,23 @@ static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp, int detail,
continue;
for (rn = bgp_table_top(table[afi]); rn;
rn = bgp_route_next(rn)) {
+ struct peer *peer;
+
bnc = bgp_node_get_bgp_nexthop_info(rn);
if (!bnc)
continue;
+ peer = (struct peer *)bnc->nht_info;
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID)) {
vty_out(vty,
- " %s valid [IGP metric %d], #paths %d\n",
+ " %s valid [IGP metric %d], #paths %d",
inet_ntop(rn->p.family,
&rn->p.u.prefix, buf,
sizeof(buf)),
bnc->metric, bnc->path_count);
+ if (peer)
+ vty_out(vty, ", peer %s", peer->host);
+ vty_out(vty, "\n");
if (!detail)
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);
} else {
- vty_out(vty, " %s invalid\n",
+ vty_out(vty, " %s invalid",
inet_ntop(rn->p.family,
&rn->p.u.prefix, buf,
sizeof(buf)));
+ if (peer)
+ vty_out(vty, ", peer %s", peer->host);
+ vty_out(vty, "\n");
if (CHECK_FLAG(bnc->flags,
BGP_NEXTHOP_CONNECTED))
vty_out(vty, " Must be Connected\n");