diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index b9836a137608..1dab2e511d95 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3191,7 +3191,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, * when trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index b2fc5c1f928e..5b97c3d7800f 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8320,7 +8320,12 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index b7e8c1578f2b..1db09e30d968 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10235,7 +10235,12 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; }