aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2018-06-08 11:28:27 -0400
committerOle Trøan <otroan@employees.org>2018-06-11 05:45:50 +0000
commitf4fd0d4217ab6c41fe6b093871bd40ac130e6486 (patch)
tree8cfb623ec6c8afaac4bed0b71967d9a8cc85e718
parent43add7ff90526f807f3bcf1e8859d900a665e266 (diff)
Fix multiple NAT translation with interface address as external
Change-Id: Idd65c6d0489bf83984a2c34d22d3f94000fc7018 Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
-rwxr-xr-xsrc/plugins/nat/nat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 1d493a6d346..5953c42f0fd 100755
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -759,14 +759,14 @@ int snat_add_static_mapping(ip4_address_t l_addr, ip4_address_t e_addr,
for (i = 0; i < vec_len (sm->to_resolve); i++)
{
rp = sm->to_resolve + i;
- if (rp->sw_if_index != sw_if_index &&
- rp->l_addr.as_u32 != l_addr.as_u32 &&
- rp->vrf_id != vrf_id && rp->addr_only != addr_only)
+ if (rp->sw_if_index != sw_if_index ||
+ rp->l_addr.as_u32 != l_addr.as_u32 ||
+ rp->vrf_id != vrf_id || rp->addr_only != addr_only)
continue;
if (!addr_only)
{
- if (rp->l_port != l_port && rp->e_port != e_port && rp->proto != proto)
+ if (rp->l_port != l_port || rp->e_port != e_port || rp->proto != proto)
continue;
}