summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-03-26 18:37:43 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-04-06 19:22:43 +0200
commit3a9210c22043112b325f3772a9db541ad6bb0792 (patch)
tree50f6006536bb284c18a909b3ad2d3d500154a176 /pbrd
parentzebra: Add code to notice nexthop changes for pbr tables (diff)
downloadfrr-3a9210c22043112b325f3772a9db541ad6bb0792.tar.xz
frr-3a9210c22043112b325f3772a9db541ad6bb0792.zip
pbrd: Indicate command failure a bit better
When a command is attempted to be configed and it fails to be installed, indicate via vtysh return codes that we did not accept the command Ticket: CM-20216 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_vty.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index e19bbcb63..9800baf67 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -152,7 +152,7 @@ DEFPY(pbr_map_nexthop_group, pbr_map_nexthop_group_cmd,
if (pbrms->nhg) {
vty_out(vty,
"A `set nexthop XX` command already exists, please remove that first\n");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
nhgc = nhgc_find(name);
@@ -169,14 +169,14 @@ DEFPY(pbr_map_nexthop_group, pbr_map_nexthop_group_cmd,
vty_out(vty,
"Nexthop Group specified: %s does not exist to remove",
name);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
} else {
if (pbrms->nhgrp_name) {
if (strcmp(name, pbrms->nhgrp_name) != 0) {
vty_out(vty,
"Please delete current nexthop group before modifying current one");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -207,7 +207,7 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
if (pbrms->nhgrp_name) {
vty_out(vty,
"Please unconfigure the nexthop group before adding an individual nexthop");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
if (name)
@@ -217,7 +217,7 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
if (!vrf) {
vty_out(vty, "Specified: %s is non-existent\n", name);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
memset(&nhop, 0, sizeof(nhop));
@@ -232,7 +232,7 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
vty_out(vty,
"Specified Intf %s does not exist in vrf: %s\n",
intf, vrf->name);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
} else
nhop.type = NEXTHOP_TYPE_IPV4;
@@ -245,7 +245,7 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
vty_out(vty,
"Specified Intf %s does not exist in vrf: %s\n",
intf, vrf->name);
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
} else
nhop.type = NEXTHOP_TYPE_IPV6;
@@ -258,7 +258,7 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
if (no) {
vty_out(vty, "No nexthops to delete");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
pbrms->nhg = nexthop_group_new();
@@ -279,7 +279,7 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
if (pbrms->nhg->nexthop) {
vty_out(vty,
"If you would like more than one nexthop please use nexthop-groups");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
/* must be adding new nexthop since !no and !nexthop_exists */