vnet_buffer(b)->sw_if_index[VLIB_TX] = sm->outside_fib_index;
}
-static void
+static snat_session_t *
snat_in2out_lb (snat_main_t *sm,
vlib_buffer_t * b,
ip4_header_t * ip,
l_key.protocol = proto;
l_key.fib_index = rx_fib_index;
if (snat_static_mapping_match(sm, l_key, &e_key, 0, 0))
- return;
+ return 0;
u_key.addr = ip->src_address;
u_key.fib_index = rx_fib_index;
s->last_heard = now;
s->total_pkts++;
s->total_bytes += vlib_buffer_length_in_chain (vm, b);
+ return s;
}
static inline uword
{
if (is_slow_path)
{
- snat_in2out_lb(sm, b0, ip0, rx_fib_index0, thread_index,
+ s0 = snat_in2out_lb(sm, b0, ip0, rx_fib_index0, thread_index,
now, vm);
goto trace00;
}
{
if (is_slow_path)
{
- snat_in2out_lb(sm, b1, ip1, rx_fib_index1, thread_index,
+ s1 = snat_in2out_lb(sm, b1, ip1, rx_fib_index1, thread_index,
now, vm);
goto trace01;
}
{
if (is_slow_path)
{
- snat_in2out_lb(sm, b0, ip0, rx_fib_index0, thread_index,
+ s0 = snat_in2out_lb(sm, b0, ip0, rx_fib_index0, thread_index,
now, vm);
goto trace0;
}
s->per_user_index);
}
-static void
+static snat_session_t *
snat_out2in_lb (snat_main_t *sm,
vlib_buffer_t * b,
ip4_header_t * ip,
e_key.protocol = proto;
e_key.fib_index = rx_fib_index;
if (snat_static_mapping_match(sm, e_key, &l_key, 1, 0))
- return;
+ return 0;
u_key.addr = l_key.addr;
u_key.fib_index = l_key.fib_index;
s->last_heard = now;
s->total_pkts++;
s->total_bytes += vlib_buffer_length_in_chain (vm, b);
+ return s;
}
static uword
{
if (PREDICT_FALSE (value0.value == ~0ULL))
{
- snat_out2in_lb(sm, b0, ip0, rx_fib_index0, thread_index, now,
+ s0 = snat_out2in_lb(sm, b0, ip0, rx_fib_index0, thread_index, now,
vm);
goto trace0;
}
{
if (PREDICT_FALSE (value1.value == ~0ULL))
{
- snat_out2in_lb(sm, b1, ip1, rx_fib_index1, thread_index, now,
+ s1 = snat_out2in_lb(sm, b1, ip1, rx_fib_index1, thread_index, now,
vm);
goto trace1;
}
{
if (PREDICT_FALSE (value0.value == ~0ULL))
{
- snat_out2in_lb(sm, b0, ip0, rx_fib_index0, thread_index, now,
+ s0 = snat_out2in_lb(sm, b0, ip0, rx_fib_index0, thread_index, now,
vm);
goto trace00;
}