Fix multiple NAT translation with interface address as external

Change-Id: Idd65c6d0489bf83984a2c34d22d3f94000fc7018
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
This commit is contained in:
Alexander Chernavin
2018-06-08 11:28:27 -04:00
committed by Ole Trøan
parent 43add7ff90
commit f4fd0d4217

View File

@ -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;
}