diff options
Diffstat (limited to 'ospfd/ospf_vty.c')
| -rw-r--r-- | ospfd/ospf_vty.c | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 87aef1ea97..4cbd4b4a99 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -507,7 +507,7 @@ DEFUN (ospf_network_area, ret = ospf_network_set(ospf, &p, area_id, format); if (ret == 0) { vty_out(vty, "There is already same network statement.\n"); - return CMD_WARNING_CONFIG_FAILED; + return CMD_WARNING; } return CMD_SUCCESS; @@ -847,7 +847,7 @@ static int ospf_vl_set_security(struct ospf_vl_data *vl_data, != NULL) { vty_out(vty, "OSPF: Key %d already exists\n", vl_config->crypto_key_id); - return CMD_WARNING_CONFIG_FAILED; + return CMD_WARNING; } ck = ospf_crypt_key_new(); ck->key_id = vl_config->crypto_key_id; @@ -2268,7 +2268,9 @@ DEFUN (no_ospf_timers_lsa_min_arrival, return CMD_SUCCESS; } -/* Deprecated: 08/07/2017 */ +#if CONFDATE > 20180708 +CPP_NOTICE("ospf: `timers lsa arrival (0-1000)` deprecated 2017/07/08") +#endif ALIAS_HIDDEN (ospf_timers_lsa_min_arrival, ospf_timers_lsa_arrival_cmd, "timers lsa arrival (0-1000)", @@ -2277,7 +2279,9 @@ ALIAS_HIDDEN (ospf_timers_lsa_min_arrival, "ospf minimum arrival interval delay\n" "delay (msec) between accepted lsas\n"); -/* Deprecated: 08/07/2017 */ +#if CONFDATE > 20180708 +CPP_NOTICE("ospf: `no timers lsa arrival (0-1000)` deprecated 2017/07/08") +#endif ALIAS_HIDDEN (no_ospf_timers_lsa_min_arrival, no_ospf_timers_lsa_arrival_cmd, "no timers lsa arrival (0-1000)", @@ -2306,7 +2310,10 @@ DEFUN (ospf_neighbor, unsigned int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT; unsigned int interval = OSPF_POLL_INTERVAL_DEFAULT; - inet_aton(argv[idx_ipv4]->arg, &nbr_addr); + if (!inet_aton(argv[idx_ipv4]->arg, &nbr_addr)) { + vty_out(vty, "Please specify Neighbor ID by A.B.C.D\n"); + return CMD_WARNING_CONFIG_FAILED; + } if (argc > 2) priority = strtoul(argv[idx_pri]->arg, NULL, 10); @@ -2343,7 +2350,10 @@ DEFUN (ospf_neighbor_poll_interval, unsigned int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT; unsigned int interval = OSPF_POLL_INTERVAL_DEFAULT; - inet_aton(argv[idx_ipv4]->arg, &nbr_addr); + if (!inet_aton(argv[idx_ipv4]->arg, &nbr_addr)) { + vty_out(vty, "Please specify Neighbor ID by A.B.C.D\n"); + return CMD_WARNING_CONFIG_FAILED; + } interval = strtoul(argv[idx_poll]->arg, NULL, 10); @@ -2374,7 +2384,10 @@ DEFUN (no_ospf_neighbor, int idx_ipv4 = 2; struct in_addr nbr_addr; - inet_aton(argv[idx_ipv4]->arg, &nbr_addr); + if (!inet_aton(argv[idx_ipv4]->arg, &nbr_addr)) { + vty_out(vty, "Please specify Neighbor ID by A.B.C.D\n"); + return CMD_WARNING_CONFIG_FAILED; + } (void)ospf_nbr_nbma_unset(ospf, nbr_addr); @@ -2396,7 +2409,10 @@ DEFUN (no_ospf_neighbor_poll, int idx_ipv4 = 2; struct in_addr nbr_addr; - inet_aton(argv[idx_ipv4]->arg, &nbr_addr); + if (!inet_aton(argv[idx_ipv4]->arg, &nbr_addr)) { + vty_out(vty, "Please specify Neighbor ID by A.B.C.D\n"); + return CMD_WARNING_CONFIG_FAILED; + } (void)ospf_nbr_nbma_unset(ospf, nbr_addr); @@ -5950,7 +5966,7 @@ DEFUN (ip_ospf_message_digest_key, key_id = strtol(keyid, NULL, 10); if (ospf_crypt_key_lookup(params->auth_crypt, key_id) != NULL) { vty_out(vty, "OSPF: Key %d already exists\n", key_id); - return CMD_WARNING_CONFIG_FAILED; + return CMD_WARNING; } ck = ospf_crypt_key_new(); @@ -6958,7 +6974,10 @@ DEFUN (ip_ospf_area, // Check if we have an address arg and proccess it if (argc == idx + 3) { - inet_aton(argv[idx + 2]->arg, &addr); + if (!inet_aton(argv[idx + 2]->arg, &addr)) { + vty_out(vty, "Please specify Intf Address by A.B.C.D\n"); + return CMD_WARNING_CONFIG_FAILED; + } // update/create address-level params params = ospf_get_if_params((ifp), (addr)); if (OSPF_IF_PARAM_CONFIGURED(params, if_area)) { @@ -7017,7 +7036,10 @@ DEFUN (no_ip_ospf_area, // Check if we have an address arg and proccess it if (argc == idx + 3) { - inet_aton(argv[idx + 2]->arg, &addr); + if (!inet_aton(argv[idx + 2]->arg, &addr)) { + vty_out(vty, "Please specify Intf Address by A.B.C.D\n"); + return CMD_WARNING_CONFIG_FAILED; + } params = ospf_lookup_if_params(ifp, addr); if ((params) == NULL) return CMD_SUCCESS; @@ -8152,8 +8174,8 @@ static int config_write_interface(struct vty *vty) if (ifp->ifindex == IFINDEX_DELETED) continue; - vty_out(vty, "!\n"); - vty_out(vty, "interface %s\n", ifp->name); + vty_frame(vty, "!\n"); + vty_frame(vty, "interface %s\n", ifp->name); if (ifp->desc) vty_out(vty, " description %s\n", ifp->desc); @@ -8367,6 +8389,8 @@ static int config_write_interface(struct vty *vty) } while (rn); ospf_opaque_config_write_if(vty, ifp); + + vty_endframe(vty, NULL); } return write; |
