Skip to content

Commit 03f942a

Browse files
mgsmith1000Damjan Marion
authored andcommitted
NAT44 - unknown protocols work with forwarding
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 <[email protected]>
1 parent 599a16b commit 03f942a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/plugins/nat/out2in.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,8 +1103,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
11031103
{
11041104
s0 = snat_out2in_unknown_proto(sm, b0, ip0, rx_fib_index0,
11051105
thread_index, now, vm, node);
1106-
if (!s0)
1107-
next0 = SNAT_OUT2IN_NEXT_DROP;
1106+
if (!sm->forwarding_enabled)
1107+
if (!s0)
1108+
next0 = SNAT_OUT2IN_NEXT_DROP;
11081109
goto trace0;
11091110
}
11101111

@@ -1273,8 +1274,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
12731274
{
12741275
s1 = snat_out2in_unknown_proto(sm, b1, ip1, rx_fib_index1,
12751276
thread_index, now, vm, node);
1276-
if (!s1)
1277-
next1 = SNAT_OUT2IN_NEXT_DROP;
1277+
if (!sm->forwarding_enabled)
1278+
if (!s1)
1279+
next1 = SNAT_OUT2IN_NEXT_DROP;
12781280
goto trace1;
12791281
}
12801282

@@ -1469,8 +1471,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
14691471
{
14701472
s0 = snat_out2in_unknown_proto(sm, b0, ip0, rx_fib_index0,
14711473
thread_index, now, vm, node);
1472-
if (!s0)
1473-
next0 = SNAT_OUT2IN_NEXT_DROP;
1474+
if (!sm->forwarding_enabled)
1475+
if (!s0)
1476+
next0 = SNAT_OUT2IN_NEXT_DROP;
14741477
goto trace00;
14751478
}
14761479

0 commit comments

Comments
 (0)