session: avoid spurious disconnect and reset ntfs

Type: fix

Change-Id: Icdc9d1c8b7b29827ce17920dae64a365bb8a4e40
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/session/session_input.c b/src/vnet/session/session_input.c
index 91e4b90..e686881 100644
--- a/src/vnet/session/session_input.c
+++ b/src/vnet/session/session_input.c
@@ -194,11 +194,13 @@
 	  break;
 	case SESSION_CTRL_EVT_DISCONNECTED:
 	  s = session_get (evt->session_index, thread_index);
-	  app->cb_fns.session_disconnect_callback (s);
+	  if (s->session_state <= SESSION_STATE_TRANSPORT_CLOSING)
+	    app->cb_fns.session_disconnect_callback (s);
 	  break;
 	case SESSION_CTRL_EVT_RESET:
 	  s = session_get (evt->session_index, thread_index);
-	  app->cb_fns.session_reset_callback (s);
+	  if (s->session_state <= SESSION_STATE_TRANSPORT_CLOSING)
+	    app->cb_fns.session_reset_callback (s);
 	  break;
 	case SESSION_CTRL_EVT_UNLISTEN_REPLY:
 	  if (is_builtin)