summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_cli.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-01-16 22:47:55 +0100
committerDamjan Marion <damarion@cisco.com>2022-01-17 10:47:26 +0100
commit81bb6fc611d321a92ad2218e1b852db67980768a (patch)
tree66d88554a59d1e225347aca663f132475596f8bc /src/vnet/interface_cli.c
parent7b90f669d83f432f3610ec0da522bd8ccc4dff01 (diff)
vnet: introduce vnet_error()
Decouples vnet return values from API return codes. New vnet_error() creates vnet_error_t whicgh contains both vnet function return value and return string. vnet_api_error() converts vlib_error_t constructed with vnet_error() to API return value. Type: improvement Change-Id: I17042954d48c010150fc1dfc5fce9330e8149e87 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/interface_cli.c')
-rw-r--r--src/vnet/interface_cli.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index d2e748abec2..740a8af78ec 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -1158,6 +1158,7 @@ mtu_cmd (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd)
u32 hw_if_index, sw_if_index, mtu;
ethernet_main_t *em = &ethernet_main;
u32 mtus[VNET_N_MTU] = { 0, 0, 0, 0 };
+ clib_error_t *err;
if (unformat (input, "%d %U", &mtu,
unformat_vnet_hw_interface, vnm, &hw_if_index))
@@ -1181,7 +1182,9 @@ mtu_cmd (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd)
return clib_error_return (0, "Invalid mtu (%d): must be <= (%d)", mtu,
hi->max_supported_packet_bytes);
- vnet_hw_interface_set_mtu (vnm, hw_if_index, mtu);
+ err = vnet_hw_interface_set_mtu (vnm, hw_if_index, mtu);
+ if (err)
+ return err;
goto done;
}
else if (unformat (input, "packet %d %U", &mtu,