Skip to contentSkip to conversation

tcp: revert to old definition of `before'

PATCH In review Gerrit Renker 2 participants 2 messages Jan 4, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: revert to old definition of `before'

Hi Dave,

as per earlier email, can you please revert the definition of the TCP `before' relation: there is code which implicitly depends on it.

Furthermore, this definition appears in textbooks such as Stevens and therefore, even if the newer definition may have nicer properties, it is safer to stick with the old one.

--------------------> Patch <------------------------------------- [TCP]: Use old definition of before

This reverts the new (unambiguous) definition of the TCP `before' relation. As pointed out in an example by Herbert Xu, there is existing code which implicitly requires the old definition in order to work correctly.

---

include/net/tcp.h +1 -1
index b7d8317..cd8fa0c 100644
@@ -242,7 +242,7 @@ extern int tcp_memory_pressure;
 
 static inline int before(__u32 seq1, __u32 seq2)
 {
-        return (__s32)(seq2-seq1) > 0;
+        return (__s32)(seq1-seq2) < 0;
 }
 #define after(seq2, seq1) 	before(seq1, seq2)
 
maintainer
#1 lore raw

From: Gerrit Renker <[email protected]>
Date: Thu, 4 Jan 2007 12:54:54 +0000

Quoted 8 lines

Hi Dave,

as per earlier email, can you please revert the definition of the TCP `before' relation: there is code which implicitly depends on it.

Furthermore, this definition appears in textbooks such as Stevens and therefore, even if the newer definition may have nicer properties, it is safer to stick with the old one.

No problem, patch applied, thanks Gerrit.