aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-12-18 08:11:37 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-12-18 15:35:20 +0000
commite6e012f6f58d7dc1a3327b2ff31dbfdf5388ef00 (patch)
treec74d39ec073aaa440de81a97ab585af06077c2e5 /src
parent798150b195025e7e5e581f9102c98b84d48a999d (diff)
Fix nat44 identity mapping
Set l_addr to the interface address if the interface address is known when the identity mapping is created. Change-Id: I61af0f5248c9d86d23a24457b342b2e1fb4ac726 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/nat/nat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index ef26d2243fd..6aa2d81f073 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -466,7 +466,12 @@ int snat_add_static_mapping(ip4_address_t l_addr, ip4_address_t e_addr,
return 0;
}
else
+ {
e_addr.as_u32 = first_int_addr->as_u32;
+ /* Identity mapping? */
+ if (l_addr.as_u32 == 0)
+ l_addr.as_u32 = e_addr.as_u32;
+ }
}
m_key.addr = e_addr;