mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:13:08 +00:00
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
This commit is contained in:
parent
15b1d9d0b0
commit
22aefb2270
@ -1187,7 +1187,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);
|
inet_ntop (AF_INET, &rn->p.u.prefix4, buf, INET6_ADDRSTRLEN), bnc->metric, VTY_NEWLINE);
|
||||||
if (detail)
|
if (detail)
|
||||||
for (i = 0; i < bnc->nexthop_num; i++)
|
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
|
else
|
||||||
vty_out (vty, " %s invalid%s",
|
vty_out (vty, " %s invalid%s",
|
||||||
@ -1208,7 +1218,17 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail)
|
|||||||
bnc->metric, VTY_NEWLINE);
|
bnc->metric, VTY_NEWLINE);
|
||||||
if (detail)
|
if (detail)
|
||||||
for (i = 0; i < bnc->nexthop_num; i++)
|
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
|
else
|
||||||
vty_out (vty, " %s invalid%s",
|
vty_out (vty, " %s invalid%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user