summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2017-07-13 21:56:08 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2017-07-13 21:56:08 +0200
commitf1a05de982b2466907838a7e74d7d15ad4060db2 (patch)
treea41d430cf69e6603accec78238c8d86d59a389ad /lib
parentMerge pull request #807 from Jafaral/qua2frr (diff)
downloadfrr-f1a05de982b2466907838a7e74d7d15ad4060db2.tar.xz
frr-f1a05de982b2466907838a7e74d7d15ad4060db2.zip
vtysh: return non-zero for configuration failures
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
Diffstat (limited to 'lib')
-rw-r--r--lib/agentx.c2
-rw-r--r--lib/command.c20
-rw-r--r--lib/command.h1
-rw-r--r--lib/distribute.c2
-rw-r--r--lib/filter.c26
-rw-r--r--lib/grammar_sandbox.c6
-rw-r--r--lib/if.c8
-rw-r--r--lib/if_rmap.c6
-rw-r--r--lib/keychain.c14
-rw-r--r--lib/ns.c10
-rw-r--r--lib/plist.c36
-rw-r--r--lib/routemap.c34
-rw-r--r--lib/smux.c6
-rw-r--r--lib/vrf.c6
-rw-r--r--lib/vty.c4
15 files changed, 91 insertions, 90 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index d058779af..53e5f2bc5 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -197,7 +197,7 @@ DEFUN (no_agentx,
{
if (!agentx_enabled) return CMD_SUCCESS;
vty_outln (vty, "SNMP AgentX support cannot be disabled once enabled");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
void
diff --git a/lib/command.c b/lib/command.c
index 5ca4a0fda..bf36a43d3 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1150,7 +1150,7 @@ DEFUN (config_terminal,
else
{
vty_outln (vty, "VTY configuration is locked by other VTY");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
}
@@ -1722,7 +1722,7 @@ DEFUN (config_hostname,
if (!isalpha((int) word->arg[0]))
{
vty_outln (vty, "Please specify string starting with alphabet");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return cmd_hostname_set (word->arg);
@@ -1763,7 +1763,7 @@ DEFUN (config_password,
{
vty_outln (vty,
"Please specify string starting with alphanumeric");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (host.password)
@@ -1812,7 +1812,7 @@ DEFUN (config_enable_password,
else
{
vty_outln (vty, "Unknown encryption type.");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -1820,7 +1820,7 @@ DEFUN (config_enable_password,
{
vty_outln (vty,
"Please specify string starting with alphanumeric");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (host.enable)
@@ -2134,14 +2134,14 @@ set_log_file(struct vty *vty, const char *fname, int loglevel)
if (getcwd (cwd, MAXPATHLEN) == NULL)
{
zlog_err ("config_log_file: Unable to alloc mem!");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if ( (p = XMALLOC (MTYPE_TMP, strlen (cwd) + strlen (fname) + 2))
== NULL)
{
zlog_err ("config_log_file: Unable to alloc mem!");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
sprintf (p, "%s/%s", cwd, fname);
fullpath = p;
@@ -2157,7 +2157,7 @@ set_log_file(struct vty *vty, const char *fname, int loglevel)
if (!ret)
{
vty_out (vty, "can't open logfile %s\n", fname);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (host.logfile)
@@ -2371,7 +2371,7 @@ cmd_banner_motd_file (const char *file)
host.motdfile = XSTRDUP (MTYPE_HOST, file);
}
else
- success = CMD_WARNING;
+ success = CMD_WARNING_CONFIG_FAILED;
return success;
}
@@ -2390,7 +2390,7 @@ DEFUN (banner_motd_file,
if (cmd == CMD_ERR_NO_FILE)
vty_out (vty, "%s does not exist", filename);
- else if (cmd == CMD_WARNING)
+ else if (cmd == CMD_WARNING_CONFIG_FAILED)
vty_out (vty, "%s must be in %s", filename, SYSCONFDIR);
return cmd;
diff --git a/lib/command.h b/lib/command.h
index 9768380c7..4a261499d 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -178,6 +178,7 @@ struct cmd_node
#define CMD_SUCCESS_DAEMON 10
#define CMD_ERR_NO_FILE 11
#define CMD_SUSPEND 12
+#define CMD_WARNING_CONFIG_FAILED 13
/* Argc max counts. */
#define CMD_ARGC_MAX 25
diff --git a/lib/distribute.c b/lib/distribute.c
index 79d7b18ff..02c888b69 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -350,7 +350,7 @@ DEFUN (no_distribute_list,
if (! ret)
{
vty_outln (vty, "distribute list doesn't exist");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
}
diff --git a/lib/filter.c b/lib/filter.c
index 3cef49b2d..d2c80fc2a 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -577,7 +577,7 @@ vty_access_list_remark_unset (struct vty *vty, afi_t afi, const char *name)
if (! access)
{
vty_outln (vty, "%% access-list %s doesn't exist",name);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (access->remark)
@@ -616,21 +616,21 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str,
else
{
vty_outln (vty, "%% filter type must be permit or deny");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ret = inet_aton (addr_str, &addr);
if (ret <= 0)
{
vty_outln (vty,"%%Inconsistent address and mask");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ret = inet_aton (addr_mask_str, &addr_mask);
if (ret <= 0)
{
vty_outln (vty,"%%Inconsistent address and mask");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (extended)
@@ -639,14 +639,14 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str,
if (ret <= 0)
{
vty_outln (vty,"%%Inconsistent address and mask");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ret = inet_aton (mask_mask_str, &mask_mask);
if (ret <= 0)
{
vty_outln (vty,"%%Inconsistent address and mask");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -1259,7 +1259,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
vty_outln (vty, "%% ACL name %s is invalid: length exceeds "
"%d characters",
name_str, ACL_NAMSIZ);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Check of filter type. */
@@ -1270,7 +1270,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
else
{
vty_outln (vty, "filter type must be [permit|deny]");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Check string format of prefix and prefixlen. */
@@ -1280,7 +1280,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
if (ret <= 0)
{
vty_outln (vty,"IP address prefix/prefixlen is malformed");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
else if (afi == AFI_IP6)
@@ -1289,11 +1289,11 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str,
if (ret <= 0)
{
vty_outln (vty,"IPv6 address prefix/prefixlen is malformed");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
else
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
mfilter = filter_new ();
mfilter->type = type;
@@ -1425,7 +1425,7 @@ DEFUN (no_access_list_all,
if (access == NULL)
{
vty_outln (vty, "%% access-list %s doesn't exist",argv[idx_acl]->arg);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
master = access->master;
@@ -1602,7 +1602,7 @@ DEFUN (no_ipv6_access_list_all,
if (access == NULL)
{
vty_outln (vty, "%% access-list %s doesn't exist",argv[idx_word]->arg);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
master = access->master;
diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c
index 454e076f0..7962b5aef 100644
--- a/lib/grammar_sandbox.c
+++ b/lib/grammar_sandbox.c
@@ -399,7 +399,7 @@ DEFUN (grammar_findambig,
if (!scan && !nodegraph)
{
vty_out(vty, "nodegraph uninitialized\r\n");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
do {
@@ -442,7 +442,7 @@ DEFUN (grammar_findambig,
if (scan)
nodegraph = NULL;
- return ambig == 0 ? CMD_SUCCESS : CMD_WARNING;
+ return ambig == 0 ? CMD_SUCCESS : CMD_WARNING_CONFIG_FAILED;
}
DEFUN (grammar_init_graph,
@@ -476,7 +476,7 @@ DEFUN (grammar_access,
if (!cnode)
{
vty_outln (vty, "%% no such node");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
vty_outln (vty, "node %d", (int)cnode->node);
diff --git a/lib/if.c b/lib/if.c
index 1d6a8cb52..cea05643e 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -693,7 +693,7 @@ DEFUN (interface,
vty_outln (vty, "%% Interface name %s is invalid: length exceeds "
"%d characters",
ifname, INTERFACE_NAMSIZ);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/*Pending: need proper vrf name based lookup/(possible creation of VRF)
@@ -710,7 +710,7 @@ DEFUN (interface,
if (!ifp)
{
vty_outln (vty, "%% interface %s not in %s", ifname, vrfname);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp);
@@ -740,14 +740,14 @@ DEFUN_NOSH (no_interface,
if (ifp == NULL)
{
vty_out (vty, "%% Interface %s does not exist%s", ifname, VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
vty_out (vty, "%% Only inactive interfaces can be deleted%s",
VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if_delete(ifp);
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index 32bebd67f..492c39c6a 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -229,7 +229,7 @@ DEFUN (if_rmap,
else
{
vty_outln (vty, "route-map direction must be [in|out]");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if_rmap_set (argv[idx_ifname]->arg, type, argv[idx_rmap_name]->arg);
@@ -260,14 +260,14 @@ DEFUN (no_if_rmap,
else
{
vty_outln (vty, "route-map direction must be [in|out]");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ret = if_rmap_unset (argv[idx_ifname]->arg, type, argv[idx_routemap_name]->arg);
if (! ret)
{
vty_outln (vty, "route-map doesn't exist");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
}
diff --git a/lib/keychain.c b/lib/keychain.c
index 9fe887c2c..ab2ad3262 100644
--- a/lib/keychain.c
+++ b/lib/keychain.c
@@ -272,7 +272,7 @@ DEFUN (no_key_chain,
if (! keychain)
{
vty_outln (vty, "Can't find keychain %s", argv[idx_word]->arg);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
keychain_delete (keychain);
@@ -315,7 +315,7 @@ DEFUN (no_key,
if (! key)
{
vty_outln (vty, "Can't find key %d", index);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
key_delete (keychain, key);
@@ -478,20 +478,20 @@ key_lifetime_set (struct vty *vty, struct key_range *krange,
if (time_start < 0)
{
vty_outln (vty, "Malformed time value");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
time_end = key_str2time (etime_str, eday_str, emonth_str, eyear_str);
if (time_end < 0)
{
vty_outln (vty, "Malformed time value");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (time_end <= time_start)
{
vty_outln (vty, "Expire time is not later than start time");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
krange->start = time_start;
@@ -513,7 +513,7 @@ key_lifetime_duration_set (struct vty *vty, struct key_range *krange,
if (time_start < 0)
{
vty_outln (vty, "Malformed time value");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
krange->start = time_start;
@@ -535,7 +535,7 @@ key_lifetime_infinite_set (struct vty *vty, struct key_range *krange,
if (time_start < 0)
{
vty_outln (vty, "Malformed time value");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
krange->start = time_start;
diff --git a/lib/ns.c b/lib/ns.c
index 4d46ecd0a..71f2b3ab6 100644
--- a/lib/ns.c
+++ b/lib/ns.c
@@ -317,7 +317,7 @@ DEFUN_NOSH (ns_netns,
char *pathname = ns_netns_pathname (vty, argv[idx_name]->arg);
if (!pathname)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
ns_id = strtoul (argv[idx_number]->arg, NULL, 10);
ns = ns_get (ns_id);
@@ -326,7 +326,7 @@ DEFUN_NOSH (ns_netns,
{
vty_out (vty, "NS %u is already configured with NETNS %s%s",
ns->ns_id, ns->name, VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (!ns->name)
@@ -336,7 +336,7 @@ DEFUN_NOSH (ns_netns,
{
vty_out (vty, "Can not associate NS %u with NETNS %s%s",
ns->ns_id, ns->name, VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -358,7 +358,7 @@ DEFUN (no_ns_netns,
char *pathname = ns_netns_pathname (vty, argv[idx_name]->arg);
if (!pathname)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
ns_id = strtoul(argv[idx_number]->arg, NULL, 10);
ns = ns_lookup (ns_id);
@@ -372,7 +372,7 @@ DEFUN (no_ns_netns,
if (ns->name && strcmp (ns->name, pathname) != 0)
{
vty_outln (vty, "Incorrect NETNS file name");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
ns_disable (ns);
diff --git a/lib/plist.c b/lib/plist.c
index 339540a2b..88788b14b 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -884,7 +884,7 @@ vty_invalid_prefix_range (struct vty *vty, const char *prefix)
{
vty_outln (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value",
prefix);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
static int
@@ -921,7 +921,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
else
{
vty_outln (vty, "%% prefix type must be permit or deny");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* "any" is special token for matching any IPv4 addresses. */
@@ -941,7 +941,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0)
{
vty_outln (vty, "%% Malformed IPv4 prefix");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* make a copy to verify prefix matches mask length */
@@ -963,7 +963,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0)
{
vty_outln (vty, "%% Malformed IPv6 prefix");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* make a copy to verify prefix matches mask length */
@@ -974,7 +974,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
case AFI_L2VPN:
default:
vty_outln (vty, "%% Unrecognized AFI (%d)", afi);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
break;
}
@@ -1043,7 +1043,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if (! plist)
{
vty_outln (vty, "%% Can't find specified prefix-list");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Only prefix-list name specified, delete the entire prefix-list. */
@@ -1058,7 +1058,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if ((typestr == NULL) || (prefix == NULL))
{
vty_outln (vty, "%% Both prefix and type required");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Check sequence number. */
@@ -1079,7 +1079,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
else
{
vty_outln (vty, "%% prefix type must be permit or deny");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* "any" is special token for matching any IPv4 addresses. */
@@ -1097,7 +1097,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0)
{
vty_outln (vty, "%% Malformed IPv4 prefix");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
else if (afi == AFI_IP6)
@@ -1114,7 +1114,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if (ret <= 0)
{
vty_outln (vty, "%% Malformed IPv6 prefix");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -1124,7 +1124,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
if (pentry == NULL)
{
vty_outln (vty, "%% Can't find specified prefix-list");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Install new filter to the access_list. */
@@ -1142,7 +1142,7 @@ vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, const char *name)
if (! plist)
{
vty_outln (vty, "%% Can't find specified prefix-list");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (plist->desc)
@@ -1944,18 +1944,18 @@ prefix_bgp_orf_set (char *name, afi_t afi, struct orf_prefix *orfp,
/* ge and le value check */
if (orfp->ge && orfp->ge <= orfp->p.prefixlen)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
if (orfp->le && orfp->le <= orfp->p.prefixlen)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
if (orfp->le && orfp->ge > orfp->le)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
if (orfp->ge && orfp->le == (afi == AFI_IP ? 32 : 128))
orfp->le = 0;
plist = prefix_list_get (afi, 1, name);
if (! plist)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
if (set)
{
@@ -1966,7 +1966,7 @@ prefix_bgp_orf_set (char *name, afi_t afi, struct orf_prefix *orfp,
if (prefix_entry_dup_check (plist, pentry))
{
prefix_list_entry_free (pentry);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
prefix_list_entry_add (plist, pentry);
@@ -1978,7 +1978,7 @@ prefix_bgp_orf_set (char *name, afi_t afi, struct orf_prefix *orfp,
orfp->seq, orfp->le, orfp->ge);
if (! pentry)
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
prefix_list_entry_delete (plist, pentry, 1);
}
diff --git a/lib/routemap.c b/lib/routemap.c
index caba8afd7..da8d48192 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -522,11 +522,11 @@ generic_match_add (struct vty *vty, struct route_map_index *index,
{
case RMAP_RULE_MISSING:
vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.",
frr_protonameinst);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
@@ -579,7 +579,7 @@ generic_match_delete (struct vty *vty, struct route_map_index *index,
XFREE(MTYPE_ROUTE_MAP_RULE, dep_name);
if (rmap_name)
XFREE(MTYPE_ROUTE_MAP_NAME, rmap_name);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (type != RMAP_EVENT_MATCH_DELETED && dep_name)
@@ -606,11 +606,11 @@ generic_set_add (struct vty *vty, struct route_map_index *index,
{
case RMAP_RULE_MISSING:
vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.",
frr_protonameinst);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
return CMD_SUCCESS;
@@ -629,11 +629,11 @@ generic_set_delete (struct vty *vty, struct route_map_index *index,
{
case RMAP_RULE_MISSING:
vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR:
vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.",
frr_protonameinst);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
return CMD_SUCCESS;
@@ -2360,14 +2360,14 @@ DEFUN (set_ip_nexthop,
if (ret < 0)
{
vty_outln (vty, "%% Malformed nexthop address");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (su.sin.sin_addr.s_addr == 0 ||
IPV4_CLASS_DE(su.sin.sin_addr.s_addr))
{
vty_outln (vty,
"%% nexthop address cannot be 0.0.0.0, multicast " "or reserved");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (rmap_match_set_hook.set_ip_nexthop)
@@ -2417,12 +2417,12 @@ DEFUN (set_ipv6_nexthop_local,
if (!ret)
{
vty_outln (vty, "%% Malformed nexthop address");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (!IN6_IS_ADDR_LINKLOCAL(&addr))
{
vty_outln (vty, "%% Invalid link-local nexthop address");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (rmap_match_set_hook.set_ipv6_nexthop_local)
@@ -2578,7 +2578,7 @@ DEFUN (no_route_map_all,
if (map == NULL)
{
vty_outln (vty, "%% Could not find route-map %s", mapname);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
route_map_delete (map);
@@ -2613,7 +2613,7 @@ DEFUN (no_route_map,
if (map == NULL)
{
vty_outln (vty, "%% Could not find route-map %s", mapname);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Lookup route map index. */
@@ -2622,7 +2622,7 @@ DEFUN (no_route_map,
{
vty_outln (vty, "%% Could not find route-map entry %s %s",
mapname, prefstr);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Delete index from route map. */
@@ -2649,7 +2649,7 @@ DEFUN (rmap_onmatch_next,
{
/* Under a deny clause, match means it's finished. No need to set next */
vty_outln (vty,"on-match next not supported under route-map deny");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
index->exitpolicy = RMAP_NEXT;
}
@@ -2690,7 +2690,7 @@ DEFUN (rmap_onmatch_goto,
{
/* Under a deny clause, match means it's finished. No need to go anywhere */
vty_outln (vty,"on-match goto not supported under route-map deny");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (num)
@@ -2702,7 +2702,7 @@ DEFUN (rmap_onmatch_goto,
{
/* Can't allow you to do that, Dave */
vty_outln (vty, "can't jump backwards in route-maps");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
else
{
diff --git a/lib/smux.c b/lib/smux.c
index 6f4b45f9a..77092cdc2 100644
--- a/lib/smux.c
+++ b/lib/smux.c
@@ -1279,7 +1279,7 @@ smux_peer_oid (struct vty *vty, const char *oid_str, const char *passwd_str)
if (ret != 0)
{
vty_out (vty, "object ID malformed%s", VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (smux_oid)
@@ -1339,7 +1339,7 @@ DEFUN (smux_peer,
return CMD_SUCCESS;
}
else
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
DEFUN (smux_peer_password,
@@ -1357,7 +1357,7 @@ DEFUN (smux_peer_password,
return CMD_SUCCESS;
}
else
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
DEFUN (no_smux_peer,
diff --git a/lib/vrf.c b/lib/vrf.c
index 6ad8cd91b..d19151491 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -476,7 +476,7 @@ DEFUN_NOSH (vrf,
vty_out (vty, "%% VRF name %s is invalid: length exceeds "
"%d characters%s",
vrfname, VRF_NAMSIZ, VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
vrfp = vrf_get (VRF_UNKNOWN, vrfname);
@@ -502,14 +502,14 @@ DEFUN_NOSH (no_vrf,
if (vrfp == NULL)
{
vty_out (vty, "%% VRF %s does not exist%s", vrfname, VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (CHECK_FLAG (vrfp->status, VRF_ACTIVE))
{
vty_out (vty, "%% Only inactive VRFs can be deleted%s",
VTYNL);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
vrf_delete(vrfp);
diff --git a/lib/vty.c b/lib/vty.c
index 62c48f0fa..00a4e9bf7 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2820,7 +2820,7 @@ DEFUN (no_vty_access_class,
if (! vty_accesslist_name || (argc == 3 && strcmp(vty_accesslist_name, accesslist)))
{
vty_outln (vty,"Access-class is not currently applied to vty");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
XFREE(MTYPE_VTY, vty_accesslist_name);
@@ -2863,7 +2863,7 @@ DEFUN (no_vty_ipv6_access_class,
(argc == 4 && strcmp(vty_ipv6_accesslist_name, accesslist)))
{
vty_outln (vty,"IPv6 access-class is not currently applied to vty");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
XFREE(MTYPE_VTY, vty_ipv6_accesslist_name);