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 | |
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')
-rw-r--r-- | zebra/debug.c | 6 | ||||
-rw-r--r-- | zebra/interface.c | 80 | ||||
-rw-r--r-- | zebra/irdp_interface.c | 8 | ||||
-rw-r--r-- | zebra/router-id.c | 2 | ||||
-rw-r--r-- | zebra/rtadv.c | 18 | ||||
-rw-r--r-- | zebra/zebra_mpls_vty.c | 40 | ||||
-rw-r--r-- | zebra/zebra_routemap.c | 34 | ||||
-rw-r--r-- | zebra/zebra_vty.c | 34 | ||||
-rw-r--r-- | zebra/zserv.c | 8 |
9 files changed, 115 insertions, 115 deletions
diff --git a/zebra/debug.c b/zebra/debug.c index ba2a9ad2a..b57085464 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -96,7 +96,7 @@ DEFUN (debug_zebra_events, "Debug option set for zebra events\n") { zebra_debug_event = ZEBRA_DEBUG_EVENT; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_zebra_nht, @@ -107,7 +107,7 @@ DEFUN (debug_zebra_nht, "Debug option set for zebra next hop tracking\n") { zebra_debug_nht = ZEBRA_DEBUG_NHT; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_zebra_mpls, @@ -118,7 +118,7 @@ DEFUN (debug_zebra_mpls, "Debug option set for zebra MPLS LSPs\n") { zebra_debug_mpls = ZEBRA_DEBUG_MPLS; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_zebra_packet, diff --git a/zebra/interface.c b/zebra/interface.c index b8426c689..e3e2e2c67 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1481,7 +1481,7 @@ DEFUN (multicast, if (ret < 0) { vty_outln (vty, "Can't set multicast flag"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); } @@ -1507,7 +1507,7 @@ DEFUN (no_multicast, if (ret < 0) { vty_outln (vty, "Can't unset multicast flag"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); } @@ -1573,7 +1573,7 @@ DEFUN (shutdown_if, if (ret < 0) { vty_outln (vty, "Can't shutdown interface"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); } @@ -1599,7 +1599,7 @@ DEFUN (no_shutdown_if, if (ret < 0) { vty_outln (vty, "Can't up interface"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); @@ -1631,7 +1631,7 @@ DEFUN (bandwidth_if, if (bandwidth < 1 || bandwidth > 100000) { vty_outln (vty, "Bandwidth is invalid"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifp->bandwidth = bandwidth; @@ -1755,7 +1755,7 @@ DEFUN (link_params_enable, if (IS_ZEBRA_DEBUG_EVENT) zlog_debug ("Link-params: failed to init TE link parameters %s", ifp->name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* force protocols to update LINK STATE due to parameters change */ @@ -1833,7 +1833,7 @@ DEFUN (link_params_maxbw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_outln (vty, "link_params_maxbw: fscanf: %s",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that Maximum bandwidth is not lower than other bandwidth parameters */ @@ -1852,7 +1852,7 @@ DEFUN (link_params_maxbw, { vty_outln (vty, "Maximum Bandwidth could not be lower than others bandwidth"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Maximum Bandwidth if needed */ @@ -1876,7 +1876,7 @@ DEFUN (link_params_max_rsv_bw, { vty_outln (vty, "link_params_max_rsv_bw: fscanf: %s", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -1885,7 +1885,7 @@ DEFUN (link_params_max_rsv_bw, vty_outln (vty, "Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Maximum Reservable Bandwidth if needed */ @@ -1913,14 +1913,14 @@ DEFUN (link_params_unrsv_bw, { vty_outln (vty, "link_params_unrsv_bw: fscanf: %s", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_outln (vty, "link_params_unrsv_bw: fscanf: %s", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -1929,7 +1929,7 @@ DEFUN (link_params_unrsv_bw, vty_outln (vty, "UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Unreserved Bandwidth if needed */ @@ -1953,7 +1953,7 @@ DEFUN (link_params_admin_grp, { vty_outln (vty, "link_params_admin_grp: fscanf: %s", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Administrative Group if needed */ @@ -1996,7 +1996,7 @@ DEFUN (link_params_inter_as, if (!inet_aton (argv[idx_ipv4]->arg, &addr)) { vty_outln (vty, "Please specify Router-Addr by A.B.C.D"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } as = strtoul(argv[idx_number]->arg, NULL, 10); @@ -2071,7 +2071,7 @@ DEFUN (link_params_delay, { vty_outln (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay", iflp->min_delay, iflp->max_delay); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update delay if value is not set or change */ if (IS_PARAM_UNSET(iflp, LP_DELAY)|| iflp->av_delay != delay) @@ -2096,7 +2096,7 @@ DEFUN (link_params_delay, { vty_outln (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay", low, high); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Delays if needed */ if (IS_PARAM_UNSET(iflp, LP_DELAY) @@ -2192,7 +2192,7 @@ DEFUN (link_params_pkt_loss, { vty_outln (vty, "link_params_pkt_loss: fscanf: %s", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (fval > MAX_PKT_LOSS) @@ -2232,7 +2232,7 @@ DEFUN (link_params_res_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_outln (vty, "link_params_res_bw: fscanf: %s",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -2241,7 +2241,7 @@ DEFUN (link_params_res_bw, vty_outln (vty, "Residual Bandwidth could not be greater than Maximum Bandwidth (%g)", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Residual Bandwidth if needed */ @@ -2278,7 +2278,7 @@ DEFUN (link_params_ava_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_outln (vty, "link_params_ava_bw: fscanf: %s",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -2287,7 +2287,7 @@ DEFUN (link_params_ava_bw, vty_outln (vty, "Available Bandwidth could not be greater than Maximum Bandwidth (%g)", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Residual Bandwidth if needed */ @@ -2324,7 +2324,7 @@ DEFUN (link_params_use_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_outln (vty, "link_params_use_bw: fscanf: %s",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -2333,7 +2333,7 @@ DEFUN (link_params_use_bw, vty_outln (vty, "Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Utilized Bandwidth if needed */ @@ -2373,13 +2373,13 @@ ip_address_install (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_outln (vty, "%% Malformed address "); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ipv4_martian(&cp.prefix)) { vty_outln (vty, "%% Invalid address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifc = connected_check (ifp, (struct prefix *) &cp); @@ -2431,7 +2431,7 @@ ip_address_install (struct vty *vty, struct interface *ifp, { vty_outln (vty, "%% Can't set interface IP address: %s.", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); @@ -2457,7 +2457,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_outln (vty, "%% Malformed address "); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check current interface address. */ @@ -2465,12 +2465,12 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, if (! ifc) { vty_outln (vty, "%% Can't find address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is not configured address. */ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; UNSET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED); @@ -2480,7 +2480,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, { listnode_delete (ifp->connected, ifc); connected_free (ifc); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is real route. */ @@ -2489,7 +2489,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, { vty_outln (vty, "%% Can't unset interface IP address: %s.", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); /* we will receive a kernel notification about this route being removed. @@ -2573,13 +2573,13 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_outln (vty, "%% Malformed address "); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ipv6_martian(&cp.prefix)) { vty_outln (vty, "%% Invalid address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifc = connected_check (ifp, (struct prefix *) &cp); @@ -2627,7 +2627,7 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, { vty_outln (vty, "%% Can't set interface IP address: %s.", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); @@ -2666,7 +2666,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_outln (vty, "%% Malformed address "); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check current interface address. */ @@ -2674,12 +2674,12 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, if (! ifc) { vty_outln (vty, "%% Can't find address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is not configured address. */ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; UNSET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED); @@ -2689,7 +2689,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, { listnode_delete (ifp->connected, ifc); connected_free (ifc); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is real route. */ @@ -2698,7 +2698,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, { vty_outln (vty, "%% Can't unset interface IP address: %s.", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index ca932ac43..5fce704af 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -480,7 +480,7 @@ DEFUN (ip_irdp_minadvertinterval, else { vty_outln (vty, "%% MinAdvertInterval must be less than or equal to " "MaxAdvertInterval"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -507,7 +507,7 @@ DEFUN (ip_irdp_maxadvertinterval, else { vty_outln (vty, "%% MaxAdvertInterval must be greater than or equal to " "MinAdvertInterval"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -561,7 +561,7 @@ DEFUN (ip_irdp_address_preference, irdp=&zi->irdp; ret = inet_aton(argv[idx_ipv4]->arg, &ip); - if(!ret) return CMD_WARNING; + if(!ret) return CMD_WARNING_CONFIG_FAILED; pref = atoi(argv[idx_number]->arg); @@ -603,7 +603,7 @@ DEFUN (no_ip_irdp_address_preference, ret = inet_aton(argv[idx_ipv4]->arg, &ip); if (!ret) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; for (ALL_LIST_ELEMENTS (irdp->AdvPrefList, node, nnode, adv)) { diff --git a/zebra/router-id.c b/zebra/router-id.c index 07caef7ab..164c79b35 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -226,7 +226,7 @@ DEFUN (router_id, rid.u.prefix4.s_addr = inet_addr (argv[idx_ipv4]->arg); if (!rid.u.prefix4.s_addr) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; rid.prefixlen = 32; rid.family = AF_INET; diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 677189751..a15a736db 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -879,7 +879,7 @@ DEFUN (ipv6_nd_suppress_ra, { vty_outln (vty, "Cannot configure IPv6 Router Advertisements on this interface"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS); @@ -903,7 +903,7 @@ DEFUN (no_ipv6_nd_suppress_ra, { vty_outln (vty, "Cannot configure IPv6 Router Advertisements on this interface"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ipv6_nd_suppress_ra_set (ifp, RA_ENABLE); @@ -933,7 +933,7 @@ DEFUN (ipv6_nd_ra_interval_msec, { vty_outln (vty, "This ra-interval would conflict with configured ra-lifetime!"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (zif->rtadv.MaxRtrAdvInterval % 1000) @@ -970,7 +970,7 @@ DEFUN (ipv6_nd_ra_interval, { vty_outln (vty, "This ra-interval would conflict with configured ra-lifetime!"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (zif->rtadv.MaxRtrAdvInterval % 1000) @@ -1038,7 +1038,7 @@ DEFUN (ipv6_nd_ra_lifetime, { vty_outln (vty, "This ra-lifetime would conflict with configured ra-interval"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } zif->rtadv.AdvDefaultLifetime = lifetime; @@ -1334,7 +1334,7 @@ DEFUN (ipv6_nd_prefix, if (!ret) { vty_outln (vty, "Malformed IPv6 prefix"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ rp.AdvOnLinkFlag = !offlink; @@ -1350,7 +1350,7 @@ DEFUN (ipv6_nd_prefix, if (rp.AdvPreferredLifetime > rp.AdvValidLifetime) { vty_outln (vty, "Invalid preferred lifetime"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1387,7 +1387,7 @@ DEFUN (no_ipv6_nd_prefix, if (!ret) { vty_outln (vty, "Malformed IPv6 prefix"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ @@ -1395,7 +1395,7 @@ DEFUN (no_ipv6_nd_prefix, if (!ret) { vty_outln (vty, "Non-existant IPv6 prefix"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; 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; diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index c4f417d88..9b4b52427 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -74,10 +74,10 @@ zebra_route_match_add(struct vty *vty, { case RMAP_RULE_MISSING: vty_outln (vty, "%% Zebra Can't find rule."); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_outln (vty, "%% Zebra Argument is malformed."); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -122,10 +122,10 @@ zebra_route_match_delete (struct vty *vty, { case RMAP_RULE_MISSING: vty_outln (vty, "%% Zebra Can't find rule."); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_outln (vty, "%% Zebra Argument is malformed."); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -303,7 +303,7 @@ DEFUN (match_source_protocol, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return zebra_route_match_add (vty, "source-protocol", proto, RMAP_EVENT_MATCH_ADDED); } @@ -351,7 +351,7 @@ DEFUN (set_src, if (inet_pton(AF_INET6, argv[idx_ip]->arg, &src.ipv6) != 1) { vty_outln (vty, "%% not a valid IPv4/v6 address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } p.family = family = AF_INET6; @@ -368,7 +368,7 @@ DEFUN (set_src, if (!zebra_check_addr(&p)) { vty_outln (vty, "%% not a valid source IPv4/v6 address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) @@ -387,7 +387,7 @@ DEFUN (set_src, if (!pif) { vty_outln (vty, "%% not a local address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } VTY_DECLVAR_CONTEXT (route_map_index, index); @@ -460,7 +460,7 @@ DEFUN (ip_protocol, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (proto_rm[AFI_IP][i]) { @@ -501,7 +501,7 @@ DEFUN (no_ip_protocol, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!proto_rm[AFI_IP][i]) @@ -567,7 +567,7 @@ DEFUN (ipv6_protocol, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (proto_rm[AFI_IP6][i]) { @@ -607,7 +607,7 @@ DEFUN (no_ipv6_protocol, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!proto_rm[AFI_IP6][i]) return CMD_SUCCESS; @@ -673,7 +673,7 @@ DEFUN (ip_protocol_nht_rmap, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP][i]) { @@ -708,7 +708,7 @@ DEFUN (no_ip_protocol_nht_rmap, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!nht_rm[AFI_IP][i]) @@ -771,7 +771,7 @@ DEFUN (ipv6_protocol_nht_rmap, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i]) XFREE (MTYPE_ROUTE_MAP_NAME, nht_rm[AFI_IP6][i]); @@ -802,13 +802,13 @@ DEFUN (no_ipv6_protocol_nht_rmap, if (i < 0) { vty_outln (vty, "invalid protocol name \"%s\"", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i] && rmap && strcmp(rmap, nht_rm[AFI_IP6][i])) { vty_outln (vty, "invalid route-map \"%s\"", rmap); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i]) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6ba4c1b9d..1b3938308 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -80,7 +80,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (ret <= 0) { vty_outln (vty, "%% Malformed address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Cisco like mask notation. */ @@ -90,7 +90,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (ret == 0) { vty_outln (vty, "%% Malformed address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } p.prefixlen = ip_masklen (mask); } @@ -114,7 +114,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (!zvrf) { vty_outln (vty, "%% vrf %s is not defined", vrf_id_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Labels */ @@ -124,7 +124,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { vty_outln (vty, "%% MPLS not turned on in kernel, ignoring command"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } int rc = mpls_str2label (label_str, &snh_label.num_labels, snh_label.label); @@ -143,7 +143,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, MPLS_MAX_LABELS); break; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -153,7 +153,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (flag_str) { vty_outln (vty, "%% can not have flag %s with Null0", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) static_add_route (AFI_IP, safi, type, &p, NULL, NULL, ifindex, ifname, @@ -177,7 +177,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, break; default: vty_outln (vty, "%% Malformed flag %s ", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -287,7 +287,7 @@ DEFUN (ip_multicast_mode, else { vty_outln (vty, "Invalid mode specified"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -1993,7 +1993,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (ret <= 0) { vty_outln (vty, "%% Malformed address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (src_str) @@ -2002,7 +2002,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (ret <= 0 || src.family != AF_INET6) { vty_outln (vty, "%% Malformed source address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } src_p = (struct prefix_ipv6*)&src; } @@ -2030,7 +2030,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (!zvrf) { vty_outln (vty, "%% vrf %s is not defined", vrf_id_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Labels */ @@ -2041,7 +2041,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { vty_outln (vty, "%% MPLS not turned on in kernel, ignoring command"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } int rc = mpls_str2label (label_str, &snh_label.num_labels, snh_label.label); @@ -2060,7 +2060,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, MPLS_MAX_LABELS); break; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2070,7 +2070,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (flag_str) { vty_outln (vty, "%% can not have flag %s with Null0", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) static_add_route (AFI_IP6, SAFI_UNICAST, type, &p, src_p, NULL, ifindex, ifname, @@ -2094,7 +2094,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, break; default: vty_outln (vty, "%% Malformed flag %s ", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2105,7 +2105,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (ret != 1) { vty_outln (vty, "%% Malformed address"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } type = STATIC_IPV6_GATEWAY_IFINDEX; gate = &gate_addr; @@ -2113,7 +2113,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (!ifp) { vty_outln (vty, "%% Malformed Interface name %s", ifname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifindex = ifp->ifindex; } diff --git a/zebra/zserv.c b/zebra/zserv.c index 3da94459f..17ec7dd88 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2812,7 +2812,7 @@ DEFUN (ip_forwarding, if (ret == 0) { vty_outln (vty, "Can't turn on IP forwarding"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -2834,7 +2834,7 @@ DEFUN (no_ip_forwarding, if (ret != 0) { vty_outln (vty, "Can't turn off IP forwarding"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -2985,7 +2985,7 @@ DEFUN (ipv6_forwarding, if (ret == 0) { vty_outln (vty, "Can't turn on IPv6 forwarding"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -3007,7 +3007,7 @@ DEFUN (no_ipv6_forwarding, if (ret != 0) { vty_outln (vty, "Can't turn off IPv6 forwarding"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; |