aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-07-23 00:05:22 -0700
committerDamjan Marion <dmarion@me.com>2018-07-23 19:39:02 +0000
commitc16a23c596169e76ee2b5091e2605c543659393d (patch)
tree9cc317a207ace4bd1715c787520fdd4159af7443
parent6f9bc4e4d8a300ef716adcc613e8a82747dcf496 (diff)
NAT44: fix forwarding feature bug (VPP-1349)v18.07-rc2
Change-Id: I5009fcfde5c627d59dea3edda15486b9392134a2 Signed-off-by: Matus Fabian <matfabia@cisco.com>
-rwxr-xr-xsrc/plugins/nat/out2in.c6
-rw-r--r--test/test_nat.py19
2 files changed, 6 insertions, 19 deletions
diff --git a/src/plugins/nat/out2in.c b/src/plugins/nat/out2in.c
index ecfabc9c07a..5ae0808ace9 100755
--- a/src/plugins/nat/out2in.c
+++ b/src/plugins/nat/out2in.c
@@ -795,8 +795,8 @@ snat_out2in_node_fn (vlib_main_t * vm,
{
b0->error = node->errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
next0 = SNAT_OUT2IN_NEXT_DROP;
- goto trace0;
}
+ goto trace0;
}
/* Create session initiated by host from external network */
@@ -947,8 +947,8 @@ snat_out2in_node_fn (vlib_main_t * vm,
{
b1->error = node->errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
next1 = SNAT_OUT2IN_NEXT_DROP;
- goto trace1;
}
+ goto trace1;
}
/* Create session initiated by host from external network */
@@ -1135,8 +1135,8 @@ snat_out2in_node_fn (vlib_main_t * vm,
{
b0->error = node->errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
next0 = SNAT_OUT2IN_NEXT_DROP;
- goto trace00;
}
+ goto trace00;
}
/* Create session initiated by host from external network */
diff --git a/test/test_nat.py b/test/test_nat.py
index 973666a3f9e..363df719a75 100644
--- a/test/test_nat.py
+++ b/test/test_nat.py
@@ -1253,7 +1253,7 @@ class TestNAT44(MethodHolder):
self.verify_capture_out(capture, same_port=True, packet_num=1)
self.assert_equal(capture[0][IP].proto, IP_PROTOS.icmp)
- def _test_forwarding(self):
+ def test_forwarding(self):
""" NAT44 forwarding test """
self.vapi.nat44_interface_add_del_feature(self.pg0.sw_if_index)
@@ -1267,7 +1267,7 @@ class TestNAT44(MethodHolder):
external_ip=alias_ip)
try:
- # in2out - static mapping match
+ # static mapping match
pkts = self.create_stream_out(self.pg1)
self.pg1.add_stream(pkts)
@@ -1283,7 +1283,7 @@ class TestNAT44(MethodHolder):
capture = self.pg1.get_capture(len(pkts))
self.verify_capture_out(capture, same_port=True)
- # in2out - no static mapping match
+ # no static mapping match
host0 = self.pg0.remote_hosts[0]
self.pg0.remote_hosts[0] = self.pg0.remote_hosts[1]
@@ -1307,19 +1307,6 @@ class TestNAT44(MethodHolder):
finally:
self.pg0.remote_hosts[0] = host0
- user = self.pg0.remote_hosts[1]
- sessions = self.vapi.nat44_user_session_dump(user.ip4n, 0)
- self.assertEqual(len(sessions), 3)
- self.assertTrue(sessions[0].ext_host_valid)
- self.vapi.nat44_del_session(
- sessions[0].inside_ip_address,
- sessions[0].inside_port,
- sessions[0].protocol,
- ext_host_address=sessions[0].ext_host_address,
- ext_host_port=sessions[0].ext_host_port)
- sessions = self.vapi.nat44_user_session_dump(user.ip4n, 0)
- self.assertEqual(len(sessions), 2)
-
finally:
self.vapi.nat44_forwarding_enable_disable(0)
self.vapi.nat44_add_del_static_mapping(local_ip=real_ip,