session: accept notifies for sessions in created state
Makes sure we don't notify apps of sessions that are closing or multiple
times for the same session.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I07145e5e00bbe8eb1df2946059459e9fe05cfeb7
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 5c45cf2..7fe35c2 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1133,6 +1133,8 @@
app_wrk = app_worker_get_if_valid (s->app_wrk_index);
if (!app_wrk)
return -1;
+ if (s->session_state != SESSION_STATE_CREATED)
+ return 0;
s->session_state = SESSION_STATE_ACCEPTING;
if (app_worker_accept_notify (app_wrk, s))
{