Author: jtl
Date: Tue Apr  3 13:54:38 2018
New Revision: 331926
URL: https://svnweb.freebsd.org/changeset/base/331926

Log:
  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.
  
  Reviewed by:  gallatin
  MFC after:    3 days
  Sponsored by: Netflix, Inc.
  Differential Revision:        https://reviews.freebsd.org/D14937

Modified:
  head/sys/netinet/tcp_seq.h

Modified: head/sys/netinet/tcp_seq.h
==============================================================================
--- head/sys/netinet/tcp_seq.h  Tue Apr  3 13:30:40 2018        (r331925)
+++ head/sys/netinet/tcp_seq.h  Tue Apr  3 13:54:38 2018        (r331926)
@@ -47,10 +47,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))
_______________________________________________
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