NAT44 - unknown protocols work with forwarding 40/10940/2
authorMatthew Smith <mgsmith@netgate.com>
Fri, 2 Mar 2018 17:31:26 +0000 (11:31 -0600)
committerDamjan Marion <dmarion.lists@gmail.com>
Mon, 5 Mar 2018 08:03:43 +0000 (08:03 +0000)
If forwarding is enabled, inbound packets on an outside
interface should not be dropped and instead pass on to
the FIB lookup. This works for TCP and UDP but not other
IP protocols. Enable it for unknown protocols.

Change-Id: I1da84b5633a36b3e5e64079754db2fcc50f29819
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
src/plugins/nat/out2in.c

index 4589c48..f6d6a0a 100755 (executable)
@@ -1103,8 +1103,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
             {
               s0 = snat_out2in_unknown_proto(sm, b0, ip0, rx_fib_index0,
                                              thread_index, now, vm, node);
-              if (!s0)
-                next0 = SNAT_OUT2IN_NEXT_DROP;
+             if (!sm->forwarding_enabled)
+               if (!s0)
+                 next0 = SNAT_OUT2IN_NEXT_DROP;
               goto trace0;
             }
 
@@ -1273,8 +1274,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
             {
               s1 = snat_out2in_unknown_proto(sm, b1, ip1, rx_fib_index1,
                                              thread_index, now, vm, node);
-              if (!s1)
-                next1 = SNAT_OUT2IN_NEXT_DROP;
+             if (!sm->forwarding_enabled)
+               if (!s1)
+                 next1 = SNAT_OUT2IN_NEXT_DROP;
               goto trace1;
             }
 
@@ -1469,8 +1471,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
             {
               s0 = snat_out2in_unknown_proto(sm, b0, ip0, rx_fib_index0,
                                              thread_index, now, vm, node);
-              if (!s0)
-                next0 = SNAT_OUT2IN_NEXT_DROP;
+             if (!sm->forwarding_enabled)
+               if (!s0)
+                 next0 = SNAT_OUT2IN_NEXT_DROP;
               goto trace00;
             }