nat: fix coverity warning 98/34098/1
authorKlement Sekera <ksekera@cisco.com>
Wed, 13 Oct 2021 19:18:59 +0000 (21:18 +0200)
committerKlement Sekera <ksekera@cisco.com>
Wed, 13 Oct 2021 19:18:59 +0000 (21:18 +0200)
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: I9b5e8c08346bea1e2b460bb09e962c4b8d3b6947

src/plugins/nat/nat44-ed/nat44_ed_cli.c

index 413c795..6f4485c 100644 (file)
@@ -983,7 +983,7 @@ add_identity_mapping_command_fn (vlib_main_t * vm,
 
   int rv, is_add = 1, port_set = 0;
   u32 sw_if_index, port, flags, vrf_id = ~0;
-  nat_protocol_t proto;
+  nat_protocol_t proto = NAT_PROTOCOL_OTHER;
   ip4_address_t addr;
 
   flags = NAT_SM_FLAG_IDENTITY_NAT;