X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fin2out_ed.c;h=2d2be5c3812332b61cb1ffdba7fa94e5b571bcdb;hb=d3b8c861a44e70c197ab721fa3ce7f38bbeab7fd;hp=733e4f0c0e5379765a9b620e2f3daea54ae23438;hpb=9fb6d40eb3d4a2da8f45187de773498b784596e6;p=vpp.git diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c index 733e4f0c0e5..2d2be5c3812 100644 --- a/src/plugins/nat/in2out_ed.c +++ b/src/plugins/nat/in2out_ed.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1005,6 +1006,18 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, udp0->dst_port, thread_index, sw_if_index0, vnet_buffer (b0)->sw_if_index[VLIB_TX]))) goto trace00; + + /* + * Send DHCP packets to the ipv4 stack, or we won't + * be able to use dhcp client on the outside interface + */ + if (PREDICT_FALSE + ((b0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED) + && proto0 == SNAT_PROTOCOL_UDP + && (udp0->dst_port == + clib_host_to_net_u16 + (UDP_DST_PORT_dhcp_to_server)))) + goto trace00; } else { @@ -1228,6 +1241,18 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, udp1->dst_port, thread_index, sw_if_index1, vnet_buffer (b1)->sw_if_index[VLIB_TX]))) goto trace01; + + /* + * Send DHCP packets to the ipv4 stack, or we won't + * be able to use dhcp client on the outside interface + */ + if (PREDICT_FALSE + ((b1->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED) + && proto1 == SNAT_PROTOCOL_UDP + && (udp1->dst_port == + clib_host_to_net_u16 + (UDP_DST_PORT_dhcp_to_server)))) + goto trace01; } else { @@ -1495,6 +1520,18 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, udp0->dst_port, thread_index, sw_if_index0, vnet_buffer (b0)->sw_if_index[VLIB_TX]))) goto trace0; + + /* + * Send DHCP packets to the ipv4 stack, or we won't + * be able to use dhcp client on the outside interface + */ + if (PREDICT_FALSE + ((b0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED) + && proto0 == SNAT_PROTOCOL_UDP + && (udp0->dst_port == + clib_host_to_net_u16 + (UDP_DST_PORT_dhcp_to_server)))) + goto trace0; } else { @@ -1796,6 +1833,18 @@ nat44_ed_in2out_reass_node_fn_inline (vlib_main_t * vm, &fragments_to_loopback); goto trace0; } + + /* + * Send DHCP packets to the ipv4 stack, or we won't + * be able to use dhcp client on the outside interface + */ + if (PREDICT_FALSE + ((b0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED) + && proto0 == SNAT_PROTOCOL_UDP + && (udp0->dst_port == + clib_host_to_net_u16 + (UDP_DST_PORT_dhcp_to_server)))) + goto trace0; } else {