提交 837d107c 编写于 作者: I Ian McDonald 提交者: David S. Miller

[DCCP]: Introduces follows48 function

This adds a new function to see if two sequence numbers follow each
other.

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e6bccd35
...@@ -81,6 +81,14 @@ static inline u64 max48(const u64 seq1, const u64 seq2) ...@@ -81,6 +81,14 @@ static inline u64 max48(const u64 seq1, const u64 seq2)
return after48(seq1, seq2) ? seq1 : 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 { enum {
DCCP_MIB_NUM = 0, DCCP_MIB_NUM = 0,
DCCP_MIB_ACTIVEOPENS, /* ActiveOpens */ DCCP_MIB_ACTIVEOPENS, /* ActiveOpens */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册