aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-07-26 12:12:17 +0200
committerFlorin Coras <fcoras@cisco.com>2016-07-26 12:12:17 +0200
commit0f1c29c9d45edcc2d226a8e519db3e56888e3181 (patch)
tree7dda5c0dd0ff99870ea7767bb14cb85532153726
parent5c55e6bd04a04cdf79329461b38e362b25a8c143 (diff)
Fix Coverty warning in lisp_add_del_map_resolver_command_fn
Change-Id: I074d9e026ae42aa14caedc56287816ab64968425 Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r--vnet/vnet/lisp-cp/control.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vnet/vnet/lisp-cp/control.c b/vnet/vnet/lisp-cp/control.c
index bea37004f72..78e730f5a5d 100644
--- a/vnet/vnet/lisp-cp/control.c
+++ b/vnet/vnet/lisp-cp/control.c
@@ -2175,7 +2175,7 @@ lisp_add_del_map_resolver_command_fn (vlib_main_t * vm,
vlib_cli_command_t * cmd)
{
unformat_input_t _line_input, * line_input = &_line_input;
- u8 is_add = 1;
+ u8 is_add = 1, addr_set = 0;
ip_address_t ip_addr;
clib_error_t * error = 0;
int rv = 0;
@@ -2192,13 +2192,20 @@ lisp_add_del_map_resolver_command_fn (vlib_main_t * vm,
else if (unformat (line_input, "del"))
is_add = 0;
else if (unformat (line_input, "%U", unformat_ip_address, &ip_addr))
- ;
+ addr_set = 1;
else
{
error = unformat_parse_error(line_input);
goto done;
}
}
+
+ if (!addr_set)
+ {
+ error = clib_error_return(0, "Map-resolver address must be set!");
+ goto done;
+ }
+
a->is_add = is_add;
a->address = ip_addr;
rv = vnet_lisp_add_del_map_resolver (a);