Skip to contentSkip to conversation

: Fix for follows48

PATCH In review Gerrit Renker 2 participants 2 messages Dec 15, 2006 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 4/8 : Fix for follows48

[DCCP]: Fix for follows48

The follows48 relation identifies the whether 48-bit sequence number x is the direct successor of y. Currently, it does not handle all cases such as

	follows48(0x(prefix)10000LL, 0x(prefix)0FFFFLL)

correctly (where prefix is an arbitrary hex sequence of up to 7 digits).

This is fixed by reusing the new dccp_delta_seqno function.

---
 net/dccp/dccp.h |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/dccp/dccp.h +1 -3
@@ -146,9 +146,7 @@ static inline u64 max48(const u64 seq1, 
 /* is seq1 next seqno after seq2 */
 static inline int follows48(const u64 seq1, const u64 seq2)
 {
-	int diff = (seq1 & 0xFFFF) - (seq2 & 0xFFFF);
-
-	return diff=1;
+	return dccp_delta_seqno(seq2, seq1) = 1;
 }
 
 enum {
Acked-by on v1 4/8
#1 lore raw
Quoted 2 lines · Gerrit Renker

[DCCP]: Fix for follows48

Signature · 3 lines
Web: http://wand.net.nz/~iam4
Blog: http://imcdnzl.blogspot.com
WAND Network Research Group