mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 10:38:05 +00:00
Merge pull request #1410 from chiragshah6/mdev
ospfd: clearnup [no] router ospf command
This commit is contained in:
commit
49d087178d
@ -139,35 +139,29 @@ static struct ospf *ospf_cmd_lookup_ospf(struct vty *vty,
|
|||||||
u_short *instance)
|
u_short *instance)
|
||||||
{
|
{
|
||||||
struct ospf *ospf = NULL;
|
struct ospf *ospf = NULL;
|
||||||
int idx_vrf = 0;
|
int idx_vrf = 0, idx_inst = 0;
|
||||||
const char *vrf_name = NULL;
|
const char *vrf_name = NULL;
|
||||||
|
|
||||||
|
*instance = 0;
|
||||||
|
if (argv_find(argv, argc, "(1-65535)", &idx_inst))
|
||||||
|
*instance = strtoul(argv[idx_inst]->arg, NULL, 10);
|
||||||
|
|
||||||
if (argv_find(argv, argc, "vrf", &idx_vrf)) {
|
if (argv_find(argv, argc, "vrf", &idx_vrf)) {
|
||||||
vrf_name = argv[idx_vrf + 1]->arg;
|
vrf_name = argv[idx_vrf + 1]->arg;
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if (argc > 4)
|
|
||||||
*instance = strtoul(argv[2]->arg, NULL, 10);
|
|
||||||
/* Allocate VRF aware instance */
|
/* Allocate VRF aware instance */
|
||||||
ospf = ospf_get(*instance, vrf_name);
|
ospf = ospf_get(*instance, vrf_name);
|
||||||
} else {
|
} else {
|
||||||
if (argc > 5)
|
|
||||||
*instance = strtoul(argv[3]->arg, NULL, 10);
|
|
||||||
ospf = ospf_lookup_by_inst_name(*instance, vrf_name);
|
ospf = ospf_lookup_by_inst_name(*instance, vrf_name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
|
ospf = ospf_get(*instance, NULL);
|
||||||
if (!ospf)
|
|
||||||
vty_out(vty,
|
|
||||||
"There isn't active ospf instance\n");
|
|
||||||
if (argc > 2)
|
|
||||||
*instance = strtoul(argv[2]->arg, NULL, 10);
|
|
||||||
} else {
|
} else {
|
||||||
if (argc > 3)
|
|
||||||
*instance = strtoul(argv[3]->arg, NULL, 10);
|
|
||||||
ospf = ospf_lookup_instance(*instance);
|
ospf = ospf_lookup_instance(*instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ospf;
|
return ospf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,6 +244,7 @@ DEFUN (no_router_ospf,
|
|||||||
else
|
else
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
}
|
}
|
||||||
|
zlog_debug("%s: no router ospf ", __PRETTY_FUNCTION__);
|
||||||
ospf_finish(ospf);
|
ospf_finish(ospf);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
@ -9282,7 +9277,7 @@ DEFUN (show_ip_ospf_vrfs,
|
|||||||
json_object_free(json);
|
json_object_free(json);
|
||||||
} else {
|
} else {
|
||||||
if (count)
|
if (count)
|
||||||
vty_out(vty, "\nTotal number of OSPF VRFs (including default): %d\n",
|
vty_out(vty, "\nTotal number of OSPF VRFs: %d\n",
|
||||||
count);
|
count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user