Skip to content

Commit

Permalink
[DCCP]: Fix elapsed time option as per section 13.2 of spec v11
Browse files Browse the repository at this point in the history
The elapsed time can be two bytes or four bytes only.

Signed-off-by: Ian McDonald <iam4@cs.waikato.ac.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ian McDonald authored and David S. Miller committed Aug 29, 2005
1 parent d179cd1 commit b1c9fe7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,7 @@ static void dccp_insert_option_ndp(struct sock *sk, struct sk_buff *skb)

static inline int dccp_elapsed_time_len(const u32 elapsed_time)
{
return elapsed_time == 0 ? 0 :
elapsed_time <= 0xFF ? 1 :
elapsed_time <= 0xFFFF ? 2 :
elapsed_time <= 0xFFFFFF ? 3 : 4;
return elapsed_time == 0 ? 0 : elapsed_time <= 0xFFFF ? 2 : 4;
}

void dccp_insert_option_elapsed_time(struct sock *sk,
Expand Down

0 comments on commit b1c9fe7

Please sign in to comment.