Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I609fef6f96c6a3fc85a4dc07e75244b0e1ba9239
nat_outside_fib_t *outside_fib;
fib_node_index_t fei = FIB_NODE_INDEX_INVALID;
clib_bihash_kv_16_8_t out2in_ed_kv;
nat_outside_fib_t *outside_fib;
fib_node_index_t fei = FIB_NODE_INDEX_INVALID;
clib_bihash_kv_16_8_t out2in_ed_kv;
- bool out2in_ed_inserted = false;
ip4_address_t allocated_addr;
u16 allocated_port;
u8 identity_nat;
ip4_address_t allocated_addr;
u16 allocated_port;
u8 identity_nat;
{
nat_elog_warn ("create NAT session failed");
b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED];
{
nat_elog_warn ("create NAT session failed");
b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED];
}
switch (vec_len (sm->outside_fibs))
{
}
switch (vec_len (sm->outside_fibs))
{
{
nat_elog_notice ("addresses exhausted");
b->error = node->errors[NAT_IN2OUT_ED_ERROR_OUT_OF_PORTS];
{
nat_elog_notice ("addresses exhausted");
b->error = node->errors[NAT_IN2OUT_ED_ERROR_OUT_OF_PORTS];
+ nat_free_session_data (sm, s, thread_index, 0);
+ nat44_ed_delete_session (sm, s, thread_index, 1);
+ return NAT_NEXT_DROP;
-
- out2in_ed_inserted = true;
key1.addr = allocated_addr;
key1.port = allocated_port;
}
key1.addr = allocated_addr;
key1.port = allocated_port;
}
{
nat_elog_warn ("create NAT session failed");
b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED];
{
nat_elog_warn ("create NAT session failed");
b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED];
}
switch (vec_len (sm->outside_fibs))
{
}
switch (vec_len (sm->outside_fibs))
{
(&tsm->out2in_ed, &out2in_ed_kv, nat44_o2i_ed_is_idle_session_cb,
&ctx))
nat_elog_notice ("out2in-ed key add failed");
(&tsm->out2in_ed, &out2in_ed_kv, nat44_o2i_ed_is_idle_session_cb,
&ctx))
nat_elog_notice ("out2in-ed key add failed");
- out2in_ed_inserted = true;
thread_index, 0);
return next;
thread_index, 0);
return next;
-drop:
- if (out2in_ed_inserted)
- {
- if (clib_bihash_add_del_16_8 (&tsm->out2in_ed, &out2in_ed_kv, 0))
- nat_elog_notice ("out2in-ed key del failed");
- }
- if (s)
- {
- nat_free_session_data (sm, s, thread_index, 0);
- nat44_ed_delete_session (sm, s, thread_index, 1);
- }
- return NAT_NEXT_DROP;
}
static_always_inline int
}
static_always_inline int