From: Florin Coras Date: Fri, 24 May 2019 05:28:16 +0000 (-0700) Subject: tcp: handle fin+rst in same frame X-Git-Tag: v19.04.1~2 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F19827%2F2;p=vpp.git tcp: handle fin+rst in same frame Change-Id: Ie7a6c7b92a6beeb356f01384216a4982fb3d420e Signed-off-by: Florin Coras --- diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 31539dfd6c3..46e2488a67d 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -811,9 +811,16 @@ session_transport_closed_notify (transport_connection_t * tc) if (!(s = session_get_if_valid (tc->s_index, tc->thread_index))) return; + /* Transport thinks that app requested close but it actually didn't. + * Can happen for tcp if fin and rst are received in close succession. */ + if (s->session_state == SESSION_STATE_READY) + { + session_transport_closing_notify (tc); + svm_fifo_dequeue_drop_all (s->tx_fifo); + } /* If app close has not been received or has not yet resulted in * a transport close, only mark the session transport as closed */ - if (s->session_state <= SESSION_STATE_CLOSING) + else if (s->session_state <= SESSION_STATE_CLOSING) { session_lookup_del_session (s); s->session_state = SESSION_STATE_TRANSPORT_CLOSED;