diff options
author | Ole Troan <ot@cisco.com> | 2021-02-06 13:02:41 +0100 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2021-02-09 09:56:56 +0000 |
commit | c9c9143898aa1f5b5aa90ab03a4c94181dcf7ed6 (patch) | |
tree | 87ece208cd36415f92566cd2b3c4aebf4abeff94 /src/plugins/nat/pnat/pnat_cli.c | |
parent | 070387d3f4b0b5a5742b95fca19404cb50fa9927 (diff) |
nat: fix coverity errors
Including a general missing free in fromjson autogenerated code.
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I9ab2b0193135e2fb3d62d51b3c114df56969e341
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins/nat/pnat/pnat_cli.c')
-rw-r--r-- | src/plugins/nat/pnat/pnat_cli.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/nat/pnat/pnat_cli.c b/src/plugins/nat/pnat/pnat_cli.c index 2d389013c08..84dfd8d5fc4 100644 --- a/src/plugins/nat/pnat/pnat_cli.c +++ b/src/plugins/nat/pnat/pnat_cli.c @@ -97,12 +97,12 @@ uword unformat_pnat_5tuple(unformat_input_t *input, va_list *args) { else if (unformat(input, "dst %U", unformat_ip4_address, &t->dst)) t->mask |= PNAT_DA; else if (unformat(input, "sport %d", &sport)) { - if (sport < 0 || sport > 65535) + if (sport == 0 || sport > 65535) return 0; t->mask |= PNAT_SPORT; t->sport = sport; } else if (unformat(input, "dport %d", &dport)) { - if (dport < 0 || dport > 65535) + if (dport == 0 || dport > 65535) return 0; t->mask |= PNAT_DPORT; t->dport = dport; |