mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 22:30:43 +00:00
eigrpd: Fix show ip eigrp vrf all topology
to actually work
Fix multiple forms of this command to behave appropriately when `vrf all` is specified. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
b31ad7fc71
commit
10b3a32521
@ -101,26 +101,12 @@ static struct eigrp *eigrp_vty_get_eigrp(struct vty *vty, const char *vrf_name)
|
||||
return eigrp_lookup(vrf->vrf_id);
|
||||
}
|
||||
|
||||
DEFPY (show_ip_eigrp_topology_all,
|
||||
show_ip_eigrp_topology_all_cmd,
|
||||
"show ip eigrp [vrf NAME] topology [all-links$all]",
|
||||
SHOW_STR
|
||||
IP_STR
|
||||
"IP-EIGRP show commands\n"
|
||||
VRF_CMD_HELP_STR
|
||||
"IP-EIGRP topology\n"
|
||||
"Show all links in topology table\n")
|
||||
static void eigrp_topology_helper(struct vty *vty, struct eigrp *eigrp,
|
||||
const char *all)
|
||||
{
|
||||
struct eigrp *eigrp;
|
||||
struct eigrp_prefix_entry *tn;
|
||||
struct route_node *rn;
|
||||
|
||||
eigrp = eigrp_vty_get_eigrp(vty, vrf);
|
||||
if (eigrp == NULL) {
|
||||
vty_out(vty, " EIGRP Routing Process not enabled\n");
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
show_ip_eigrp_topology_header(vty, eigrp);
|
||||
|
||||
for (rn = route_top(eigrp->topology_table); rn; rn = route_next(rn)) {
|
||||
@ -131,9 +117,43 @@ DEFPY (show_ip_eigrp_topology_all,
|
||||
eigrp_vty_display_prefix_entry(vty, eigrp, tn,
|
||||
all ? true : false);
|
||||
}
|
||||
}
|
||||
|
||||
DEFPY (show_ip_eigrp_topology_all,
|
||||
show_ip_eigrp_topology_all_cmd,
|
||||
"show ip eigrp [vrf NAME] topology [all-links$all]",
|
||||
SHOW_STR
|
||||
IP_STR
|
||||
"IP-EIGRP show commands\n"
|
||||
VRF_CMD_HELP_STR
|
||||
"IP-EIGRP topology\n"
|
||||
"Show all links in topology table\n")
|
||||
{
|
||||
struct eigrp *eigrp;
|
||||
|
||||
if (vrf && strncmp(vrf, "all", sizeof("all")) == 0) {
|
||||
struct vrf *v;
|
||||
|
||||
RB_FOREACH (v, vrf_name_head, &vrfs_by_name) {
|
||||
eigrp = eigrp_lookup(v->vrf_id);
|
||||
if (!eigrp)
|
||||
continue;
|
||||
|
||||
vty_out(vty, "VRF %s:\n", v->name);
|
||||
|
||||
eigrp_topology_helper(vty, eigrp, all);
|
||||
}
|
||||
} else {
|
||||
eigrp = eigrp_vty_get_eigrp(vty, vrf);
|
||||
if (eigrp == NULL) {
|
||||
vty_out(vty, " EIGRP Routing Process not enabled\n");
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
eigrp_topology_helper(vty, eigrp, all);
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
DEFPY (show_ip_eigrp_topology,
|
||||
@ -152,6 +172,11 @@ DEFPY (show_ip_eigrp_topology,
|
||||
struct route_node *rn;
|
||||
struct prefix cmp;
|
||||
|
||||
if (vrf && strncmp(vrf, "all", sizeof("all")) == 0) {
|
||||
vty_out(vty, "Specifying vrf `all` for a particular address/prefix makes no sense\n");
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
eigrp = eigrp_vty_get_eigrp(vty, vrf);
|
||||
if (eigrp == NULL) {
|
||||
vty_out(vty, " EIGRP Routing Process not enabled\n");
|
||||
|
Loading…
Reference in New Issue
Block a user