continue;
}
+ if (is_lb_session (s))
+ continue;
+
nat_free_session_data (sm, s, tsm - sm->per_thread_data);
clib_dlist_remove (tsm->list_pool, s->per_user_index);
pool_put_index (tsm->list_pool, s->per_user_index);
if (!addr_only)
break;
}
- if (addr_only)
+ if (addr_only && (u->nstaticsessions == 0))
{
pool_put (tsm->users, u);
clib_bihash_add_del_8_8 (&tsm->user_hash, &kv, 0);
elt = pool_elt_at_index (tsm->list_pool, elt->next);
ses_index = elt->value;
+ if (!(is_lb_session (s)))
+ continue;
+
if ((s->in2out.addr.as_u32 != local->addr.as_u32) &&
(clib_net_to_host_u16 (s->in2out.port) != local->port))
continue;
* address.
* @param is_addr_only If matched mapping is address only
* @param twice_nat If matched mapping is twice NAT.
+ * @param lb If matched mapping is load-balanced.
*
* @returns 0 if match found otherwise 1.
*/
snat_session_key_t * mapping,
u8 by_external,
u8 *is_addr_only,
- u8 *twice_nat)
+ u8 *twice_nat,
+ u8 *lb)
{
clib_bihash_kv_8_8_t kv, value;
snat_static_mapping_t *m;
if (PREDICT_FALSE(twice_nat != 0))
*twice_nat = m->twice_nat;
+ if (PREDICT_FALSE(lb != 0))
+ *lb = vec_len (m->locals) > 0;
+
return 0;
}