summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/out2in.c
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2018-02-09 21:04:08 -0600
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-14 14:49:14 +0000
commit6d2f214dab3984995bdbe03ad30487ac2d01b555 (patch)
tree8fb1d023fe5734ab5224470553034b45ba5bbf0a /src/plugins/nat/out2in.c
parent554075a51f30ea842d3bf558e392d2c16f1acf83 (diff)
NAT44 out2in DHCP client next node
Call vnet_feature_next() for DHCP replies instead of using default ip4-lookup. This allows DHCP replies to reach an outside interface if it's configured as a DHCP client. Change-Id: Icce1cd68b21256fcd6b1fad6792c06578b0e4e36 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/plugins/nat/out2in.c')
-rwxr-xr-xsrc/plugins/nat/out2in.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/plugins/nat/out2in.c b/src/plugins/nat/out2in.c
index 7f500a916f0..a03f780ba5e 100755
--- a/src/plugins/nat/out2in.c
+++ b/src/plugins/nat/out2in.c
@@ -1105,10 +1105,14 @@ snat_out2in_node_fn (vlib_main_t * vm,
* Send DHCP packets to the ipv4 stack, or we won't
* be able to use dhcp client on the outside interface
*/
- if (proto0 != SNAT_PROTOCOL_UDP
+ if (PREDICT_TRUE (proto0 != SNAT_PROTOCOL_UDP
|| (udp0->dst_port
- != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client)))
+ != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client))))
next0 = SNAT_OUT2IN_NEXT_DROP;
+ else
+ vnet_feature_next
+ (vnet_buffer (b0)->sw_if_index[VLIB_RX],
+ &next0, b0);
goto trace0;
}
else
@@ -1268,10 +1272,14 @@ snat_out2in_node_fn (vlib_main_t * vm,
* Send DHCP packets to the ipv4 stack, or we won't
* be able to use dhcp client on the outside interface
*/
- if (proto1 != SNAT_PROTOCOL_UDP
+ if (PREDICT_TRUE (proto1 != SNAT_PROTOCOL_UDP
|| (udp1->dst_port
- != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client)))
+ != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client))))
next1 = SNAT_OUT2IN_NEXT_DROP;
+ else
+ vnet_feature_next
+ (vnet_buffer (b1)->sw_if_index[VLIB_RX],
+ &next1, b1);
goto trace1;
}
else
@@ -1467,10 +1475,14 @@ snat_out2in_node_fn (vlib_main_t * vm,
* Send DHCP packets to the ipv4 stack, or we won't
* be able to use dhcp client on the outside interface
*/
- if (proto0 != SNAT_PROTOCOL_UDP
+ if (PREDICT_TRUE (proto0 != SNAT_PROTOCOL_UDP
|| (udp0->dst_port
- != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client)))
+ != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client))))
next0 = SNAT_OUT2IN_NEXT_DROP;
+ else
+ vnet_feature_next
+ (vnet_buffer (b0)->sw_if_index[VLIB_RX],
+ &next0, b0);
goto trace00;
}
else
@@ -1707,10 +1719,14 @@ nat44_out2in_reass_node_fn (vlib_main_t * vm,
* Send DHCP packets to the ipv4 stack, or we won't
* be able to use dhcp client on the outside interface
*/
- if (proto0 != SNAT_PROTOCOL_UDP
+ if (PREDICT_TRUE (proto0 != SNAT_PROTOCOL_UDP
|| (udp0->dst_port
- != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client)))
+ != clib_host_to_net_u16(UDP_DST_PORT_dhcp_to_client))))
next0 = SNAT_OUT2IN_NEXT_DROP;
+ else
+ vnet_feature_next
+ (vnet_buffer (b0)->sw_if_index[VLIB_RX],
+ &next0, b0);
goto trace0;
}
else