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 /zebra/zebra_mpls_vty.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 'zebra/zebra_mpls_vty.c')
-rw-r--r-- | zebra/zebra_mpls_vty.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c index 6c2dbca3a..a7031f692 100644 --- a/zebra/zebra_mpls_vty.c +++ b/zebra/zebra_mpls_vty.c @@ -54,20 +54,20 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!mpls_enabled) { vty_outln (vty,"%% MPLS not turned on in kernel, ignoring command"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } zvrf = vrf_info_lookup(VRF_DEFAULT); if (!zvrf) { vty_outln (vty, "%% Default VRF does not exist"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!inlabel_str) { vty_outln (vty, "%% No Label Information"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } out_label = MPLS_IMP_NULL_LABEL; /* as initialization */ @@ -75,7 +75,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!IS_MPLS_UNRESERVED_LABEL(label)) { vty_outln (vty, "%% Invalid label"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -83,12 +83,12 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!gate_str) { vty_outln (vty, "%% No Nexthop Information"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!outlabel_str) { vty_outln (vty, "%% No Outgoing label Information"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -109,7 +109,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, else { vty_outln (vty, "%% Invalid nexthop"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } } @@ -134,7 +134,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, &gate, 0)) { vty_outln (vty,"%% Label value not consistent"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } #endif /* HAVE_CUMULUS */ @@ -148,7 +148,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, { vty_outln (vty, "%% LSP cannot be %s", add_cmd ? "added" : "deleted"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -219,7 +219,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (!zvrf) { vty_outln (vty, "%% Default VRF does not exist"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } memset(&p, 0, sizeof(struct prefix)); @@ -227,7 +227,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (ret <= 0) { vty_outln (vty, "%% Malformed address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -235,7 +235,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (!label_str) { vty_outln (vty, "%% No label binding specified"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!strcmp(label_str, "implicit-null")) @@ -253,12 +253,12 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (!IS_MPLS_UNRESERVED_LABEL(label)) { vty_outln (vty, "%% Invalid label"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (zebra_mpls_label_already_bound (zvrf, label)) { vty_outln (vty,"%% Label already bound to a FEC"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -271,7 +271,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, { vty_outln (vty, "%% FEC to label binding cannot be %s", add_cmd ? "added" : "deleted"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -943,7 +943,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (!zvrf) { vty_outln (vty, "%% Default VRF does not exist"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -951,7 +951,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (!start_label_str || !end_label_str) { vty_outln (vty, "%% Labels not specified"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } start_label = atoi(start_label_str); @@ -960,12 +960,12 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, !IS_MPLS_UNRESERVED_LABEL(end_label)) { vty_outln (vty, "%% Invalid label"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (end_label < start_label) { vty_outln (vty,"%% End label is less than Start label"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = zebra_mpls_label_block_add (zvrf, start_label, end_label); @@ -977,7 +977,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, { vty_outln (vty, "%% Global label block could not be %s", add_cmd ? "added" : "deleted"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; |