summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2017-07-14 12:24:01 +0200
committerGitHub <noreply@github.com>2017-07-14 12:24:01 +0200
commit905c15079393987f8cfdd55c30e7e1a3248c8c48 (patch)
tree0a210b213a525f2880cd694b2e45833e8430d282 /ripngd
parentMerge pull request #817 from donaldsharp/babel_redist (diff)
parentvtysh: return non-zero for configuration failures (diff)
downloadfrr-905c15079393987f8cfdd55c30e7e1a3248c8c48.tar.xz
frr-905c15079393987f8cfdd55c30e7e1a3248c8c48.zip
Merge pull request #815 from dwalton76/CMD_WARNING_take2
vtysh: return non-zero for configuration failures
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ripng_debug.c6
-rw-r--r--ripngd/ripng_interface.c8
-rw-r--r--ripngd/ripng_offset.c10
-rw-r--r--ripngd/ripng_zebra.c10
-rw-r--r--ripngd/ripngd.c28
5 files changed, 31 insertions, 31 deletions
diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c
index 9ba0e10e4..74a93d8eb 100644
--- a/ripngd/ripng_debug.c
+++ b/ripngd/ripng_debug.c
@@ -69,7 +69,7 @@ DEFUN (debug_ripng_events,
"Debug option set for ripng events\n")
{
ripng_debug_event = RIPNG_DEBUG_EVENT;
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
DEFUN (debug_ripng_packet,
@@ -112,7 +112,7 @@ DEFUN (debug_ripng_zebra,
"Debug option set for ripng and zebra communication\n")
{
ripng_debug_zebra = RIPNG_DEBUG_ZEBRA;
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
DEFUN (no_debug_ripng_events,
@@ -176,7 +176,7 @@ DEFUN (no_debug_ripng_zebra,
"Debug option set for ripng and zebra communication\n")
{
ripng_debug_zebra = 0;
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Debug node. */
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index d739540c2..8daad0803 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -858,7 +858,7 @@ static int
ripng_passive_interface_set (struct vty *vty, const char *ifname)
{
if (ripng_passive_interface_lookup (ifname) >= 0)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
vector_set (Vripng_passive_interface, strdup (ifname));
@@ -875,7 +875,7 @@ ripng_passive_interface_unset (struct vty *vty, const char *ifname)
i = ripng_passive_interface_lookup (ifname);
if (i < 0)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
str = vector_slot (Vripng_passive_interface, i);
free (str);
@@ -962,7 +962,7 @@ DEFUN (ripng_network,
{
vty_outln (vty, "There is same network configuration %s",
argv[idx_if_or_addr]->arg);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -991,7 +991,7 @@ DEFUN (no_ripng_network,
if (ret < 0)
{
vty_outln (vty, "can't find network %s",argv[idx_if_or_addr]->arg);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c
index 51385dd93..df460a00f 100644
--- a/ripngd/ripng_offset.c
+++ b/ripngd/ripng_offset.c
@@ -126,7 +126,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist,
else
{
vty_outln (vty, "Invalid direction: %s", direct_str);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Check metric. */
@@ -134,7 +134,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist,
if (metric < 0 || metric > 16)
{
vty_outln (vty, "Invalid metric: %s", metric_str);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Get offset-list structure with interface name. */
@@ -165,7 +165,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist,
else
{
vty_outln (vty, "Invalid direction: %s", direct_str);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Check metric. */
@@ -173,7 +173,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist,
if (metric < 0 || metric > 16)
{
vty_outln (vty, "Invalid metric: %s", metric_str);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Get offset-list structure with interface name. */
@@ -197,7 +197,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist,
else
{
vty_outln (vty, "Can't find offset-list");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
}
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index 465d33992..132422ed8 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -338,7 +338,7 @@ DEFUN (ripng_redistribute_type,
if (type < 0)
{
vty_outln (vty, "Invalid type %s", proto);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP6, type, 0, VRF_DEFAULT);
@@ -364,7 +364,7 @@ DEFUN (no_ripng_redistribute_type,
if (type < 0)
{
vty_outln (vty, "Invalid type %s", proto);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng_redistribute_metric_unset (type);
@@ -392,7 +392,7 @@ DEFUN (ripng_redistribute_type_metric,
if (type < 0)
{
vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng_redistribute_metric_set (type, metric);
@@ -418,7 +418,7 @@ DEFUN (ripng_redistribute_type_routemap,
if (type < 0)
{
vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng_redistribute_routemap_set (type, argv[idx_word]->text);
@@ -449,7 +449,7 @@ DEFUN (ripng_redistribute_type_metric_routemap,
if (type < 0)
{
vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng_redistribute_metric_set (type, metric);
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index bfec173ef..15fce90c2 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2227,7 +2227,7 @@ DEFUN_NOSH (router_ripng,
if (ret < 0)
{
zlog_warn ("can't create RIPng");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -2261,7 +2261,7 @@ DEFUN (ripng_route,
if (ret <= 0)
{
vty_outln (vty, "Malformed address");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
apply_mask_ipv6 (&p);
@@ -2270,7 +2270,7 @@ DEFUN (ripng_route,
{
vty_outln (vty, "There is already same static route.");
route_unlock_node (rp);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
rp->info = (void *)1;
@@ -2295,7 +2295,7 @@ DEFUN (no_ripng_route,
if (ret <= 0)
{
vty_outln (vty, "Malformed address");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
apply_mask_ipv6 (&p);
@@ -2303,7 +2303,7 @@ DEFUN (no_ripng_route,
if (! rp)
{
vty_outln (vty, "Can't find static route.");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng_redistribute_delete (ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p, 0);
@@ -2330,7 +2330,7 @@ DEFUN (ripng_aggregate_address,
if (ret <= 0)
{
vty_outln (vty, "Malformed address");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Check aggregate alredy exist or not. */
@@ -2339,7 +2339,7 @@ DEFUN (ripng_aggregate_address,
{
vty_outln (vty, "There is already same aggregate route.");
route_unlock_node (node);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
node->info = (void *)1;
@@ -2364,14 +2364,14 @@ DEFUN (no_ripng_aggregate_address,
if (ret <= 0)
{
vty_outln (vty, "Malformed address");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
rn = route_node_lookup (ripng->aggregate, &p);
if (! rn)
{
vty_outln (vty, "Can't find aggregate route.");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
route_unlock_node (rn);
rn->info = NULL;
@@ -2426,7 +2426,7 @@ DEFUN (ripng_update_timer,
if (update == ULONG_MAX || *endptr != '\0')
{
vty_out (vty, "update timer value error%s", VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->update_time = update;
@@ -2461,7 +2461,7 @@ DEFUN (ripng_timeout_timer,
if (timeout == ULONG_MAX || *endptr != '\0')
{
vty_out (vty, "timeout timer value error%s", VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->timeout_time = timeout;
@@ -2494,7 +2494,7 @@ DEFUN (ripng_garbage_timer,
if (garbage == ULONG_MAX || *endptr != '\0')
{
vty_out (vty, "garbage timer value error%s", VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->garbage_time = garbage;
@@ -2681,7 +2681,7 @@ DEFUN (ripng_allow_ecmp,
if (ripng->ecmp)
{
vty_outln (vty, "ECMP is already enabled.");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->ecmp = 1;
@@ -2698,7 +2698,7 @@ DEFUN (no_ripng_allow_ecmp,
if (!ripng->ecmp)
{
vty_outln (vty, "ECMP is already disabled.");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->ecmp = 0;