[DCCP]: Fix elapsed time option as per section 13.2 of spec v11
authorIan McDonald <iam4@cs.waikato.ac.nz>
Thu, 18 Aug 2005 23:45:29 +0000 (20:45 -0300)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 29 Aug 2005 23:02:03 +0000 (16:02 -0700)
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>
net/dccp/options.c

index d87d6be..85a86bd 100644 (file)
@@ -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,