mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 02:30:52 +00:00
bgpd: show martian nexthops improve code flow
The show martian nexthops command for bgp had some strangely duplicated code. Refactor. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
85c58de773
commit
e61f7c0a10
@ -192,17 +192,10 @@ static void show_address_entry(struct hash_bucket *bucket, void *args)
|
|||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
char str[INET6_ADDRSTRLEN] = {0};
|
char str[INET6_ADDRSTRLEN] = {0};
|
||||||
|
|
||||||
if (addr->p->family == AF_INET) {
|
vty_out(vty, "addr: %s, count: %d : ",
|
||||||
vty_out(vty, "addr: %s, count: %d : ", inet_ntop(AF_INET,
|
inet_ntop(addr->p->family, &(addr->p->u.prefix),
|
||||||
&(addr->p->u.prefix4),
|
str, INET6_ADDRSTRLEN),
|
||||||
str, INET_ADDRSTRLEN),
|
addr->ifp_name_list->count);
|
||||||
addr->ifp_name_list->count);
|
|
||||||
} else if (addr->p->family == AF_INET6) {
|
|
||||||
vty_out(vty, "addr: %s, count: %d : ", inet_ntop(AF_INET6,
|
|
||||||
&(addr->p->u.prefix6),
|
|
||||||
str, INET6_ADDRSTRLEN),
|
|
||||||
addr->ifp_name_list->count);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(addr->ifp_name_list, node, name)) {
|
for (ALL_LIST_ELEMENTS_RO(addr->ifp_name_list, node, name)) {
|
||||||
vty_out(vty, " %s,", name);
|
vty_out(vty, " %s,", name);
|
||||||
|
Loading…
Reference in New Issue
Block a user