session: cleanup lcl endpt freelist before all alloc
Make sure endpoint freelist is drained before alloc of fixed local source port is tried. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I302deee5609a463af8135185af71722ac8c55a27
This commit is contained in:

committed by
Dave Wallace

parent
1552228350
commit
02aa2ca093
@@ -578,10 +578,6 @@ transport_alloc_local_port (u8 proto, ip46_address_t *lcl_addr,
|
||||
/* Only support active opens from one of ctrl threads */
|
||||
ASSERT (vlib_get_thread_index () <= transport_cl_thread ());
|
||||
|
||||
/* Cleanup freelist if need be */
|
||||
if (vec_len (tm->lcl_endpts_freelist))
|
||||
transport_cleanup_freelist ();
|
||||
|
||||
/* Search for first free slot */
|
||||
for (tries = 0; tries < limit; tries++)
|
||||
{
|
||||
@@ -669,6 +665,7 @@ transport_alloc_local_endpoint (u8 proto, transport_endpoint_cfg_t * rmt_cfg,
|
||||
ip46_address_t * lcl_addr, u16 * lcl_port)
|
||||
{
|
||||
transport_endpoint_t *rmt = (transport_endpoint_t *) rmt_cfg;
|
||||
transport_main_t *tm = &tp_main;
|
||||
session_error_t error;
|
||||
int port;
|
||||
|
||||
@@ -689,6 +686,10 @@ transport_alloc_local_endpoint (u8 proto, transport_endpoint_cfg_t * rmt_cfg,
|
||||
sizeof (rmt_cfg->peer.ip));
|
||||
}
|
||||
|
||||
/* Cleanup freelist if need be */
|
||||
if (vec_len (tm->lcl_endpts_freelist))
|
||||
transport_cleanup_freelist ();
|
||||
|
||||
/*
|
||||
* Allocate source port
|
||||
*/
|
||||
|
Reference in New Issue
Block a user