- }
-
- pkts_processed += next0 == nat_buffer_opaque (b0)->arc_next;
-
- ip1 = (ip4_header_t *) ((u8 *) vlib_buffer_get_current (b1) +
- iph_offset1);
-
- sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_RX];
- rx_fib_index1 =
- fib_table_get_index_for_sw_if_index (FIB_PROTOCOL_IP4,
- sw_if_index1);
-
- if (PREDICT_FALSE (ip1->ttl == 1))
- {
- vnet_buffer (b1)->sw_if_index[VLIB_TX] = (u32) ~ 0;
- icmp4_error_set_vnet_buffer (b1, ICMP4_time_exceeded,
- ICMP4_time_exceeded_ttl_exceeded_in_transit,
- 0);
- next1 = NAT_NEXT_ICMP_ERROR;
- goto trace01;
- }
-
- udp1 = ip4_next_header (ip1);
- tcp1 = (tcp_header_t *) udp1;
- icmp1 = (icmp46_header_t *) udp1;
- proto1 = ip_proto_to_snat_proto (ip1->protocol);
-
- if (is_slow_path)
- {
- if (PREDICT_FALSE (proto1 == ~0))
- {
- s1 = nat44_ed_in2out_unknown_proto (sm, b1, ip1,
- rx_fib_index1,
- thread_index, now,
- vm, node);
- if (!s1)
- next1 = NAT_NEXT_DROP;
- other_packets++;
- goto trace01;
- }
-
- if (PREDICT_FALSE (proto1 == SNAT_PROTOCOL_ICMP))
- {
- next1 = icmp_in2out_ed_slow_path
- (sm, b1, ip1, icmp1, sw_if_index1, rx_fib_index1,
- node, next1, now, thread_index, &s1);
- icmp_packets++;
- goto trace01;
- }
- }
- else
- {
- if (PREDICT_FALSE (proto1 == ~0))
- {
- next1 = def_slow;
- goto trace01;
- }
-
- if (is_output_feature)
- {
- if (PREDICT_FALSE
- (nat_not_translate_output_feature_fwd
- (sm, ip1, thread_index, now, vm, b1)))
- goto trace01;
- }
-
- if (PREDICT_FALSE (proto1 == SNAT_PROTOCOL_ICMP))
- {
- next1 = def_slow;
- goto trace01;
- }
- }
-
- make_ed_kv (&kv1, &ip1->src_address, &ip1->dst_address,
- ip1->protocol, rx_fib_index1,
- vnet_buffer (b1)->ip.reass.l4_src_port,
- vnet_buffer (b1)->ip.reass.l4_dst_port);
-
- if (clib_bihash_search_16_8 (&tsm->in2out_ed, &kv1, &value1))
- {
- if (is_slow_path)
- {
- if (is_output_feature)
- {
- if (PREDICT_FALSE
- (nat44_ed_not_translate_output_feature
- (sm, ip1, ip1->protocol,
- vnet_buffer (b1)->ip.reass.l4_src_port,
- vnet_buffer (b1)->ip.reass.l4_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
- && (vnet_buffer (b1)->ip.reass.l4_dst_port ==
- clib_host_to_net_u16
- (UDP_DST_PORT_dhcp_to_server))))
- goto trace01;
- }
- else
- {
- if (PREDICT_FALSE (nat44_ed_not_translate (sm, node,
- sw_if_index1,
- ip1,
- proto1,
- rx_fib_index1,
- thread_index)))
- goto trace01;
- }
-
- next1 =
- slow_path_ed (sm, b1, rx_fib_index1, &kv1, &s1, node,
- next1, thread_index, now);
-
- if (PREDICT_FALSE (next1 == NAT_NEXT_DROP))
- goto trace01;
-
- if (PREDICT_FALSE (!s1))
- goto trace01;
- }