nat: fix coverity warning 05/34205/2
authorKlement Sekera <ksekera@cisco.com>
Fri, 22 Oct 2021 10:52:34 +0000 (12:52 +0200)
committerDamjan Marion <dmarion@me.com>
Sat, 30 Oct 2021 11:04:12 +0000 (11:04 +0000)
Fix coverity warning by initialising proto variable to a dummy value.
This value is never used because consuming function uses this parameter
value only if is_addr_only flag is not set and this flag is always set
if proto value is not provided by user.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I041bc821a392f0746ef9f07f9b259d62884305b7

src/plugins/nat/nat44-ei/nat44_ei_cli.c

index f3e7198..36d98a4 100644 (file)
@@ -1112,7 +1112,7 @@ add_identity_mapping_command_fn (vlib_main_t *vm, unformat_input_t *input,
 
   int rv, is_add = 1, port_set = 0;
   u32 sw_if_index = ~0, port, flags, vrf_id = ~0;
-  nat_protocol_t proto;
+  nat_protocol_t proto = NAT_PROTOCOL_OTHER;
   ip4_address_t addr;
 
   flags = NAT44_EI_SM_FLAG_IDENTITY_NAT;