aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-11-23 15:59:36 -0800
committerDamjan Marion <dmarion@me.com>2020-11-24 10:22:08 +0000
commit473556dcf13bd7e1d8165563ebe5cd97aa5e6c12 (patch)
tree06ab184a261b55bf6dcb542bee3adde50cc2548b /src/vnet/session
parent5c2a23720f433aa5ddcc1b077ddb91f494ff958d (diff)
session: init lookup before dgram accept notification
Avoids potential session pointer invalidation Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ide9ba0ab732707d3dda6019ebb77f0b9489dfda7
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 9429ddb3c8a..3a468b4c286 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1158,16 +1158,18 @@ session_dgram_accept (transport_connection_t * tc, u32 listener_index,
return rv;
}
+ session_lookup_add_connection (tc, session_handle (s));
+
app_wrk = app_worker_get (s->app_wrk_index);
if ((rv = app_worker_accept_notify (app_wrk, s)))
{
+ session_lookup_del_session (s);
segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo);
session_free (s);
return rv;
}
s->session_state = SESSION_STATE_READY;
- session_lookup_add_connection (tc, session_handle (s));
return 0;
}