Commit b16be51b authored by Gerrit Renker's avatar Gerrit Renker Committed by David S. Miller

[DCCP]: Fix for follows48

The follows48 relation identifies whether 48-bit sequence number
x is the direct successor of y. Currently, it does not handle cases
of the following type correctly:

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

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

This is fixed by reusing the new dccp_delta_seqno function.
Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d52de17b
...@@ -144,9 +144,7 @@ static inline u64 max48(const u64 seq1, const u64 seq2) ...@@ -144,9 +144,7 @@ static inline u64 max48(const u64 seq1, const u64 seq2)
/* is seq1 next seqno after seq2 */ /* is seq1 next seqno after seq2 */
static inline int follows48(const u64 seq1, const u64 seq2) static inline int follows48(const u64 seq1, const u64 seq2)
{ {
int diff = (seq1 & 0xFFFF) - (seq2 & 0xFFFF); return dccp_delta_seqno(seq2, seq1) == 1;
return diff==1;
} }
enum { enum {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment