diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-07-13 21:56:08 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-07-13 21:56:08 +0200 |
commit | f1a05de982b2466907838a7e74d7d15ad4060db2 (patch) | |
tree | a41d430cf69e6603accec78238c8d86d59a389ad /lib/filter.c | |
parent | Merge pull request #807 from Jafaral/qua2frr (diff) | |
download | frr-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/filter.c')
-rw-r--r-- | lib/filter.c | 26 |
1 files changed, 13 insertions, 13 deletions
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; |