Ethereal-dev: [Ethereal-dev] [patch] packet-tcp.c and sequence wrap.

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: didier <dgautheron@xxxxxxxx>
Date: Wed, 18 Sep 2002 11:26:55 +0000
Hi
The code in CVS doesn't work.

It's a copy and paste from the linux kernel. (I can mail a capture with a sequence wrap).

Didier
Index: packet-tcp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-tcp.c,v
retrieving revision 1.159
diff -u -B -r1.159 packet-tcp.c
--- packet-tcp.c	2002/09/11 09:52:36	1.159
+++ packet-tcp.c	2002/09/18 11:07:49
@@ -134,10 +134,10 @@
 };
 
 /* Idea for gt: either x > y, or y is much bigger (assume wrap) */
-#define GT_SEQ(x, y) ((x > y) || ((y - x) > 0x80000000))
-#define LT_SEQ(x, y) ((x < y) || ((x - y) > 0x80000000))
-#define GE_SEQ(x, y) ((x >= y) || ((y - x) > 0x80000000))
-#define LE_SEQ(x, y) ((x <= y) || ((x - y) > 0x80000000))
+#define GT_SEQ(x, y) ((gint32)(y - x) < 0)
+#define LT_SEQ(x, y) ((gint32)(x - y) < 0)
+#define GE_SEQ(x, y) ((gint32)(y - x) <= 0)
+#define LE_SEQ(x, y) ((gint32)(x - y) <= 0)
 #define EQ_SEQ(x, y) (x == y)
 
 static GMemChunk *tcp_acked_chunk = NULL;