summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 87aef1ea97..96b6fe8bf9 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -2306,7 +2306,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 +2346,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 +2380,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 +2405,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);
@@ -6958,7 +6970,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 +7032,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;