summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.c
diff options
context:
space:
mode:
authorshubing guo <guo.shubing@zte.com.cn>2018-08-10 13:59:50 +0800
committerDamjan Marion <dmarion@me.com>2018-08-11 22:32:19 +0000
commit060c3a7e5a2d23189a8c6348e767cd2018a58dd6 (patch)
treeefcacda6f0b47b923726f67b7a0296db236b8c15 /src/plugins/nat/nat.c
parentdd8e7d0e512425ec05de652a3c71028561e0f40a (diff)
VPP-1381: Fix the incorrect if condition when delete session for static mapping
-- The session should not be deleted when either ip address or port doesn't same with static mapping. Change-Id: I09ab7379947654d2780a8c40c5340ce430541b12 Signed-off-by: shubing guo <guo.shubing@zte.com.cn>
Diffstat (limited to 'src/plugins/nat/nat.c')
-rwxr-xr-xsrc/plugins/nat/nat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 79d11136240..c30e2eacd6a 100755
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -1180,7 +1180,7 @@ int snat_add_static_mapping(ip4_address_t l_addr, ip4_address_t e_addr,
if (!addr_only)
{
- if ((s->out2in.addr.as_u32 != e_addr.as_u32) &&
+ if ((s->out2in.addr.as_u32 != e_addr.as_u32) ||
(clib_net_to_host_u16 (s->out2in.port) != e_port))
continue;
}
@@ -1465,7 +1465,7 @@ int nat44_add_del_lb_static_mapping (ip4_address_t e_addr, u16 e_port,
if (!(is_lb_session (s)))
continue;
- if ((s->in2out.addr.as_u32 != local->addr.as_u32) &&
+ if ((s->in2out.addr.as_u32 != local->addr.as_u32) ||
(clib_net_to_host_u16 (s->in2out.port) != local->port))
continue;