summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-09-07 09:13:15 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-09-07 21:30:44 +0000
commit74cac8839efae6a69baea031fb01602ef8907e8a (patch)
treec94cc43b74ef84f500664821df3338e4b7668e49 /src/vnet/session/session.c
parentd790c7e1fa5f1accb621aa75089212be586c137f (diff)
session: fix reentrant listens
Change-Id: I72d400401a308012b43513179870823f6f921e44 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 952a5a90141..c5b2124acbd 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -984,21 +984,23 @@ session_listen (stream_session_t * ls, session_endpoint_extended_t * sep)
{
transport_connection_t *tc;
transport_endpoint_t *tep;
- u32 tc_index;
+ u32 tc_index, s_index;
/* Transport bind/listen */
tep = session_endpoint_to_transport (sep);
- tc_index = tp_vfts[sep->transport_proto].bind (ls->session_index, tep);
+ s_index = ls->session_index;
+ tc_index = tp_vfts[sep->transport_proto].bind (s_index, tep);
if (tc_index == (u32) ~ 0)
return -1;
/* Attach transport to session */
+ ls = listen_session_get (s_index);
ls->connection_index = tc_index;
/* Add to the main lookup table after transport was initialized */
tc = tp_vfts[sep->transport_proto].get_listener (tc_index);
- session_lookup_add_connection (tc, ls->session_index);
+ session_lookup_add_connection (tc, s_index);
return 0;
}