Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Apr 2018 14:01:08 +0000 (UTC)
From:      "Jonathan T. Looney" <jtl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r332818 - stable/11/sys/netinet
Message-ID:  <201804201401.w3KE18d5044204@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jtl
Date: Fri Apr 20 14:01:08 2018
New Revision: 332818
URL: https://svnweb.freebsd.org/changeset/base/332818

Log:
  MFC r331926:
    r330675 introduced an extra window check in the LRO code to ensure it
    captured and reported the highest window advertisement with the same
    SEQ/ACK.  However, the window comparison uses modulo 2**16 math, rather
    than directly comparing the absolute values.  Because windows use
    absolute values and not modulo 2**16 math (i.e. they don't wrap), we
    need to compare the absolute values.
  
  Sponsored by:	Netflix, Inc.

Modified:
  stable/11/sys/netinet/tcp_seq.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_seq.h
==============================================================================
--- stable/11/sys/netinet/tcp_seq.h	Fri Apr 20 13:58:48 2018	(r332817)
+++ stable/11/sys/netinet/tcp_seq.h	Fri Apr 20 14:01:08 2018	(r332818)
@@ -45,10 +45,10 @@
 #define	SEQ_MIN(a, b)	((SEQ_LT(a, b)) ? (a) : (b))
 #define	SEQ_MAX(a, b)	((SEQ_GT(a, b)) ? (a) : (b))
 
-#define	WIN_LT(a,b)	((short)(ntohs(a)-ntohs(b)) < 0)
-#define	WIN_LEQ(a,b)	((short)(ntohs(a)-ntohs(b)) <= 0)
-#define	WIN_GT(a,b)	((short)(ntohs(a)-ntohs(b)) > 0)
-#define	WIN_GEQ(a,b)	((short)(ntohs(a)-ntohs(b)) >= 0)
+#define	WIN_LT(a,b)	(ntohs(a) < ntohs(b))
+#define	WIN_LEQ(a,b)	(ntohs(a) <= ntohs(b))
+#define	WIN_GT(a,b)	(ntohs(a) > ntohs(b))
+#define	WIN_GEQ(a,b)	(ntohs(a) >= ntohs(b))
 
 #define	WIN_MIN(a, b)	((WIN_LT(a, b)) ? (a) : (b))
 #define	WIN_MAX(a, b)	((WIN_GT(a, b)) ? (a) : (b))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804201401.w3KE18d5044204>