t->is_slow_path ? "NAT44_OUT2IN_ED_SLOW_PATH" :
"NAT44_OUT2IN_ED_FAST_PATH";
- s = format (s, "%s: sw_if_index %d, next index %d, session %d", tag,
- t->sw_if_index, t->next_index, t->session_index);
+ s = format (s, "%s: sw_if_index %d, next index %d", tag, t->sw_if_index,
+ t->next_index);
if (~0 != t->session_index)
{
- s = format (s, ", translation result '%U' via %s",
- format_nat_ed_translation_error, t->translation_error,
+ s = format (s, ", session %d, translation result '%U' via %s",
+ t->session_index, format_nat_ed_translation_error,
+ t->translation_error,
t->translation_via_i2of ? "i2of" : "o2if");
s = format (s, "\n i2of %U", format_nat_6t_flow, &t->i2of);
s = format (s, "\n o2if %U", format_nat_6t_flow, &t->o2if);
}
if (snat_static_mapping_match (
- sm, ip->dst_address, lookup_sport, rx_fib_index,
+ vm, sm, ip->dst_address, lookup_sport, rx_fib_index,
ip_proto_to_nat_proto (ip->protocol), &sm_addr, &sm_port,
&sm_fib_index, 1, &is_addr_only, 0, 0, 0, &identity_nat, &m))
{
{
snat_session_t *s;
ip4_header_t *ip;
- udp_header_t *udp;
snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index];
if (PREDICT_FALSE
}
ip = vlib_buffer_get_current (b);
- udp = ip4_next_header (ip);
s->ext_host_addr.as_u32 = ip->src_address.as_u32;
- s->ext_host_port = nat_proto == NAT_PROTOCOL_ICMP ? 0 : udp->src_port;
+ s->ext_host_port =
+ nat_proto == NAT_PROTOCOL_ICMP ? 0 : vnet_buffer (b)->ip.reass.l4_src_port;
s->flags |= SNAT_SESSION_FLAG_STATIC_MAPPING;
if (lb_nat)
s->flags |= SNAT_SESSION_FLAG_LOAD_BALANCING;
ip4_header_t *ip, u32 rx_fib_index, u32 thread_index)
{
clib_bihash_kv_16_8_t kv, value;
- udp_header_t *udp;
snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index];
vlib_main_t *vm = vlib_get_main ();
f64 now = vlib_time_now (vm);
{
if (ip->protocol == IP_PROTOCOL_UDP || ip->protocol == IP_PROTOCOL_TCP)
{
- udp = ip4_next_header (ip);
- lookup_sport = udp->dst_port;
- lookup_dport = udp->src_port;
+ lookup_sport = vnet_buffer (b)->ip.reass.l4_dst_port;
+ lookup_dport = vnet_buffer (b)->ip.reass.l4_src_port;
}
else
{
/* Try to match static mapping by external address and port,
destination address and port in packet */
- if (snat_static_mapping_match
- (sm, ip0->dst_address,
- vnet_buffer (b0)->ip.reass.l4_dst_port, rx_fib_index0,
- proto0, &sm_addr, &sm_port, &sm_fib_index, 1, 0,
- &twice_nat0, &lb_nat0, &ip0->src_address, &identity_nat0, &m))
+ if (snat_static_mapping_match (
+ vm, sm, ip0->dst_address,
+ vnet_buffer (b0)->ip.reass.l4_dst_port, rx_fib_index0, proto0,
+ &sm_addr, &sm_port, &sm_fib_index, 1, 0, &twice_nat0, &lb_nat0,
+ &ip0->src_address, &identity_nat0, &m))
{
/*
* Send DHCP packets to the ipv4 stack, or we won't