Date: Tue, 7 Oct 2014 13:18:28 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r272687 - projects/sendfile/sys/netinet Message-ID: <201410071318.s97DISu9081942@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Tue Oct 7 13:18:28 2014 New Revision: 272687 URL: https://svnweb.freebsd.org/changeset/base/272687 Log: Fix three critical bugs when sbavail() was used in place of sbused(), and one non-critical. The critical ones led to FIN bit sent before remainer of data. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: projects/sendfile/sys/netinet/tcp_output.c Modified: projects/sendfile/sys/netinet/tcp_output.c ============================================================================== --- projects/sendfile/sys/netinet/tcp_output.c Tue Oct 7 13:08:52 2014 (r272686) +++ projects/sendfile/sys/netinet/tcp_output.c Tue Oct 7 13:18:28 2014 (r272687) @@ -322,7 +322,7 @@ after_sack_rexmit: * to send then the probe will be the FIN * itself. */ - if (off < sbavail(&so->so_snd)) + if (off < sbused(&so->so_snd)) flags &= ~TH_FIN; sendwin = 1; } else { @@ -503,11 +503,11 @@ after_sack_rexmit: tso = 1; if (sack_rxmit) { - if (SEQ_LT(p->rxmit + len, tp->snd_una + sbavail(&so->so_snd))) + if (SEQ_LT(p->rxmit + len, tp->snd_una + sbused(&so->so_snd))) flags &= ~TH_FIN; } else { if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + - sbavail(&so->so_snd))) + sbused(&so->so_snd))) flags &= ~TH_FIN; } @@ -979,7 +979,7 @@ send: * give data to the user when a buffer fills or * a PUSH comes in.) */ - if (off + len == sbavail(&so->so_snd)) + if (off + len == sbused(&so->so_snd)) flags |= TH_PUSH; SOCKBUF_UNLOCK(&so->so_snd); } else {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410071318.s97DISu9081942>