aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat64
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2021-05-04 16:27:33 +0200
committerOle Tr�an <otroan@employees.org>2021-05-05 13:21:24 +0000
commitae80aba3b070ad12ad4e2d587b6cdf47f0abe6e1 (patch)
treee299e32db8c81bd7deffd01ab716db5aa271a47c /src/plugins/nat/nat64
parent49a2925b1b61bd08770a3c268aacb52fafa5631c (diff)
nat: fixing cfg file parsing cli issues
Type: fix Change-Id: I35012bb2f7af1996c954641af40f3223bc7f37e4 Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat64')
-rw-r--r--src/plugins/nat/nat64/nat64_cli.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/nat/nat64/nat64_cli.c b/src/plugins/nat/nat64/nat64_cli.c
index a7dd9ab9147..3af715c2457 100644
--- a/src/plugins/nat/nat64/nat64_cli.c
+++ b/src/plugins/nat/nat64/nat64_cli.c
@@ -16,6 +16,8 @@
#include <vnet/fib/fib_table.h>
#include <nat/nat64/nat64.h>
+#define NAT64_EXPECTED_ARGUMENT "expected required argument(s)"
+
static clib_error_t *
nat64_plugin_enable_disable_command_fn (vlib_main_t * vm,
unformat_input_t * input,
@@ -27,7 +29,7 @@ nat64_plugin_enable_disable_command_fn (vlib_main_t * vm,
nat64_config_t c = { 0 };
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -79,7 +81,7 @@ nat64_add_del_pool_addr_command_fn (vlib_main_t * vm,
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -193,7 +195,7 @@ nat64_interface_feature_command_fn (vlib_main_t * vm,
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -335,7 +337,7 @@ nat64_add_del_static_bib_command_fn (vlib_main_t *
int rv;
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -462,7 +464,7 @@ nat64_show_bib_command_fn (vlib_main_t * vm,
nat64_db_t *db;
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
if (unformat (line_input, "%U", unformat_nat_protocol, &proto))
p = nat_proto_to_ip_proto (proto);
@@ -565,7 +567,7 @@ nat64_show_st_command_fn (vlib_main_t * vm,
};
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
if (unformat (line_input, "%U", unformat_nat_protocol, &proto))
p = nat_proto_to_ip_proto (proto);
@@ -613,7 +615,7 @@ nat64_add_del_prefix_command_fn (vlib_main_t * vm, unformat_input_t * input,
int rv;
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -737,7 +739,7 @@ nat64_add_interface_address_command_fn (vlib_main_t * vm,
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, NAT64_EXPECTED_ARGUMENT);
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{