From 7b929793feba7d966c34b1ddb31dc818174f3a57 Mon Sep 17 00:00:00 2001 From: Juraj Sloboda Date: Thu, 23 Nov 2017 13:20:48 +0100 Subject: Translate matching packets using NAT (VPP-1069) Add API function which enables forwarding of packets not matching existing translation or static mapping instead of dropping them. When forwarding is enabled matching packets will be translated while non-matching packets will be forwarded without translation. Change-Id: Ic13040cbad16d3a1ecdc3e02a497171bef6aa413 Signed-off-by: Juraj Sloboda --- src/plugins/nat/in2out.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/nat/in2out.c') diff --git a/src/plugins/nat/in2out.c b/src/plugins/nat/in2out.c index 603abb8ff38..517011eec06 100755 --- a/src/plugins/nat/in2out.c +++ b/src/plugins/nat/in2out.c @@ -242,6 +242,9 @@ snat_not_translate (snat_main_t * sm, vlib_node_runtime_t *node, else return 0; + if (sm->forwarding_enabled) + return 1; + return snat_not_translate_fast(sm, node, sw_if_index0, ip0, proto0, rx_fib_index0); } -- cgit 1.2.3-korg