Author: tuexen
Date: Fri Dec  2 08:02:31 2016
New Revision: 309397
URL: https://svnweb.freebsd.org/changeset/base/309397

Log:
  Fix the handling of  TCP FIN-segments in the CLOSED state
  
  When a TCP segment with the FIN bit set was received in the CLOSED state,
  a TCP RST-ACK-segment is sent. When computing SEG.ACK for this, the
  FIN counts as one byte. This accounting was missing and is fixed by this
  patch.
  
  Reviewed by:          hiren
  MFC after:            1 month
  Sponsored by:         Netflix, Inc.
  Differential Revision:        https://svn.freebsd.org/base/head

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c        Fri Dec  2 06:27:54 2016        
(r309396)
+++ head/sys/netinet/tcp_input.c        Fri Dec  2 08:02:31 2016        
(r309397)
@@ -3357,6 +3357,8 @@ tcp_dropwithreset(struct mbuf *m, struct
        } else {
                if (th->th_flags & TH_SYN)
                        tlen++;
+               if (th->th_flags & TH_FIN)
+                       tlen++;
                tcp_respond(tp, mtod(m, void *), th, m, th->th_seq+tlen,
                    (tcp_seq)0, TH_RST|TH_ACK);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to