diff options
Diffstat (limited to 'ospfd/ospf_vty.c')
| -rw-r--r-- | ospfd/ospf_vty.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index b4c456e0aa..4a7dbb9541 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -1539,7 +1539,7 @@ ospf_area_nssa_cmd_handler (struct vty *vty, int argc, struct cmd_token **argv, return CMD_WARNING; } - if (argc > 1) + if (argc > 3) { if (strncmp (argv[3]->text, "translate-c", 11) == 0) ospf_area_nssa_translator_role_set (ospf, area_id, @@ -6333,7 +6333,7 @@ DEFUN (no_ip_ospf_dead_interval, { VTY_DECLVAR_CONTEXT(interface, ifp); int idx_ipv4 = argc - 1; - struct in_addr addr; + struct in_addr addr = { .s_addr = 0L}; int ret; struct ospf_if_params *params; struct ospf_interface *oi; @@ -6465,6 +6465,7 @@ DEFUN (no_ip_ospf_hello_interval, int idx = 0; struct in_addr addr; struct ospf_if_params *params; + params = IF_DEF_PARAMS (ifp); if (argv_find (argv, argc, "A.B.C.D", &idx)) @@ -7160,7 +7161,7 @@ DEFUN (no_ospf_redistribute_source, DEFUN (ospf_redistribute_instance_source, ospf_redistribute_instance_source_cmd, - "redistribute <ospf|table> (1-65535) [<metric (0-16777214)|metric-type (1-2)|route-map WORD>]", + "redistribute <ospf|table> (1-65535) {metric (0-16777214)|metric-type (1-2)|route-map WORD}", REDIST_STR "Open Shortest Path First\n" "Non-main Kernel Routing Table\n" @@ -7176,7 +7177,7 @@ DEFUN (ospf_redistribute_instance_source, VTY_DECLVAR_CONTEXT(ospf, ospf); int idx_ospf_table = 1; int idx_number = 2; - int idx_redist_param = 3; + int idx = 3; int source; int type = -1; int metric = -1; @@ -7208,19 +7209,21 @@ DEFUN (ospf_redistribute_instance_source, } /* Get metric value. */ - if (strcmp (argv[idx_redist_param]->arg, "metric") == 0) - if (!str2metric (argv[idx_redist_param+1]->arg, &metric)) + if (argv_find (argv, argc, "metric", &idx)) + if (!str2metric (argv[idx+1]->arg, &metric)) return CMD_WARNING; + idx = 3; /* Get metric type. */ - if (strcmp (argv[idx_redist_param]->arg, "metric-type") == 0) - if (!str2metric_type (argv[idx_redist_param+1]->arg, &type)) + if (argv_find (argv, argc, "metric-type", &idx)) + if (!str2metric_type (argv[idx+1]->arg, &type)) return CMD_WARNING; red = ospf_redist_add(ospf, source, instance); - if (strcmp (argv[idx_redist_param]->arg, "route-map") == 0) - ospf_routemap_set (red, argv[idx_redist_param+1]->arg); + idx = 3; + if (argv_find (argv, argc, "route-map", &idx)) + ospf_routemap_set (red, argv[idx+1]->arg); else ospf_routemap_unset (red); @@ -7229,7 +7232,7 @@ DEFUN (ospf_redistribute_instance_source, DEFUN (no_ospf_redistribute_instance_source, no_ospf_redistribute_instance_source_cmd, - "no redistribute <ospf|table> (1-65535) [<metric (0-16777214)|metric-type (1-2)|route-map WORD>]", + "no redistribute <ospf|table> (1-65535) {metric (0-16777214)|metric-type (1-2)|route-map WORD}", NO_STR REDIST_STR "Open Shortest Path First\n" |
