summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-06-09 04:55:54 -0700
committerOle Trøan <otroan@employees.org>2017-06-12 10:04:27 +0000
commitc9b622fbace7482c59f28fe516eefcb6acb83a1b (patch)
treebd8eb03824fc3a6dfe448bdd142cac365d6393af /src
parentb8633d2570c95e27e4d7fcb95b69a23fc1671792 (diff)
NAT64: coverity fix
Change-Id: I08544b2f06f993c8a6435901232a0616d0548b94 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/snat/nat64_cli.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/snat/nat64_cli.c b/src/plugins/snat/nat64_cli.c
index 3fad75eabda..106d9aee41e 100644
--- a/src/plugins/snat/nat64_cli.c
+++ b/src/plugins/snat/nat64_cli.c
@@ -278,8 +278,8 @@ nat64_add_del_static_bib_command_fn (vlib_main_t *
u8 is_add = 1;
ip6_address_t in_addr;
ip4_address_t out_addr;
- u16 in_port;
- u16 out_port;
+ u16 in_port = 0;
+ u16 out_port = 0;
u32 vrf_id = 0;
snat_protocol_t proto = 0;
u8 p = 0;
@@ -310,6 +310,18 @@ nat64_add_del_static_bib_command_fn (vlib_main_t *
}
}
+ if (!in_port)
+ {
+ error = clib_error_return (0, "inside port and address must be set");
+ goto done;
+ }
+
+ if (!out_port)
+ {
+ error = clib_error_return (0, "outside port and address must be set");
+ goto done;
+ }
+
p = snat_proto_to_ip_proto (proto);
rv =