Skip to content

Commit

Permalink
[DCCP]: Introduces follows48 function
Browse files Browse the repository at this point in the history
This adds a new function to see if two sequence numbers follow each
other.

Signed off by: Ian McDonald <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
imcdnzl authored and davem330 committed Aug 27, 2006
1 parent e6bccd3 commit 837d107
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ static inline u64 max48(const u64 seq1, const u64 seq2)
return after48(seq1, seq2) ? seq1 : seq2;
}

/* 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;
}

enum {
DCCP_MIB_NUM = 0,
DCCP_MIB_ACTIVEOPENS, /* ActiveOpens */
Expand Down

0 comments on commit 837d107

Please sign in to comment.