diff options
author | Denis Ovsienko <infrastation@yandex.ru> | 2011-08-09 12:42:58 +0200 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2012-01-08 12:31:50 +0100 |
commit | 0e8032d69961ae196c11ba6ead856084c7acf7c2 (patch) | |
tree | f9adf1934b0b34fd3e4db4896bc83c05e471d234 /bgpd/bgp_nexthop.c | |
parent | bgpd: dismiss some zlookup checks (diff) | |
download | frr-0e8032d69961ae196c11ba6ead856084c7acf7c2.tar.xz frr-0e8032d69961ae196c11ba6ead856084c7acf7c2.zip |
bgpd: improve "show ip bgp scan detail"
* bgp_nexthop.c (show_ip_bgp_scan_tables): access proper structure field
in AF_INET6 case, handle ifindex NH type properly
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index dc448f9fa..e9c78b3f0 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -1190,7 +1190,17 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail) inet_ntop (AF_INET, &rn->p.u.prefix4, buf, INET6_ADDRSTRLEN), bnc->metric, VTY_NEWLINE); if (detail) for (i = 0; i < bnc->nexthop_num; i++) - vty_out (vty, " %s%s", inet_ntop (AF_INET, &bnc->nexthop[i].gate.ipv4, buf, INET6_ADDRSTRLEN), VTY_NEWLINE); + switch (bnc->nexthop[i].type) + { + case NEXTHOP_TYPE_IPV4: + vty_out (vty, " gate %s%s", inet_ntop (AF_INET, &bnc->nexthop[i].gate.ipv4, buf, INET6_ADDRSTRLEN), VTY_NEWLINE); + break; + case NEXTHOP_TYPE_IFINDEX: + vty_out (vty, " ifidx %u%s", bnc->nexthop[i].ifindex, VTY_NEWLINE); + break; + default: + vty_out (vty, " invalid nexthop type %u%s", bnc->nexthop[i].type, VTY_NEWLINE); + } } else vty_out (vty, " %s invalid%s", @@ -1211,7 +1221,17 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail) bnc->metric, VTY_NEWLINE); if (detail) for (i = 0; i < bnc->nexthop_num; i++) - vty_out (vty, " %s%s", inet_ntop (AF_INET6, &bnc->nexthop[i].gate.ipv4, buf, INET6_ADDRSTRLEN), VTY_NEWLINE); + switch (bnc->nexthop[i].type) + { + case NEXTHOP_TYPE_IPV6: + vty_out (vty, " gate %s%s", inet_ntop (AF_INET6, &bnc->nexthop[i].gate.ipv6, buf, INET6_ADDRSTRLEN), VTY_NEWLINE); + break; + case NEXTHOP_TYPE_IFINDEX: + vty_out (vty, " ifidx %u%s", bnc->nexthop[i].ifindex, VTY_NEWLINE); + break; + default: + vty_out (vty, " invalid nexthop type %u%s", bnc->nexthop[i].type, VTY_NEWLINE); + } } else vty_out (vty, " %s invalid%s", |