From: Florin Coras Date: Fri, 28 Jun 2019 16:18:48 +0000 (-0700) Subject: tcp: reject out-of-order fins X-Git-Tag: v20.01-rc0~294 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=f73d4c2084c9cb6df4a1f8582acef523e4ba0cb2;p=vpp.git tcp: reject out-of-order fins Type:fix Change-Id: Iab2c308739f7733dbf70953e0ea87dcc404c60da Signed-off-by: Florin Coras --- diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index 23030ee77d2..848028f6940 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -1698,6 +1698,10 @@ static void tcp_rcv_fin (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, vlib_buffer_t * b, u32 * error) { + /* Reject out-of-order fins */ + if (vnet_buffer (b)->tcp.seq_end != tc->rcv_nxt) + return; + /* Account for the FIN and send ack */ tc->rcv_nxt += 1; tcp_program_ack (wrk, tc);