summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/snat_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/snat/snat_test.c')
-rw-r--r--src/plugins/snat/snat_test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c
index 85f9d57a35e..a8cb8cc0eb5 100644
--- a/src/plugins/snat/snat_test.c
+++ b/src/plugins/snat/snat_test.c
@@ -222,6 +222,7 @@ static int api_snat_add_static_mapping(vat_main_t * vam)
u32 sw_if_index = ~0;
u8 sw_if_index_set = 0;
u32 proto = ~0;
+ u8 proto_set = 0;
int ret;
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
@@ -243,7 +244,7 @@ static int api_snat_add_static_mapping(vat_main_t * vam)
else if (unformat (i, "vrf %u", &vrf_id))
;
else if (unformat (i, "protocol %u", &proto))
- ;
+ proto_set = 1;
else if (unformat (i, "del"))
is_add = 0;
else
@@ -253,6 +254,12 @@ static int api_snat_add_static_mapping(vat_main_t * vam)
}
}
+ if (!addr_only && !proto_set)
+ {
+ errmsg ("protocol required\n");
+ return -99;
+ }
+
if (!local_addr_set)
{
errmsg ("local addr required\n");