aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIan McDonald <iam4@cs.waikato.ac.nz>2005-08-18 19:45:29 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 19:02:03 -0400
commitb1c9fe7b818acbd36dc908c5c1ad4cab34c67b39 (patch)
tree7cc9a954c01b9161e44fc90ed24692fe6d933828 /net
parentd179cd12928443f3ec29cfbc3567439644bd0afc (diff)
[DCCP]: Fix elapsed time option as per section 13.2 of spec v11
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>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/options.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index d87d6be7ab10..85a86bd61f44 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -293,10 +293,7 @@ static void dccp_insert_option_ndp(struct sock *sk, struct sk_buff *skb)
293 293
294static inline int dccp_elapsed_time_len(const u32 elapsed_time) 294static inline int dccp_elapsed_time_len(const u32 elapsed_time)
295{ 295{
296 return elapsed_time == 0 ? 0 : 296 return elapsed_time == 0 ? 0 : elapsed_time <= 0xFFFF ? 2 : 4;
297 elapsed_time <= 0xFF ? 1 :
298 elapsed_time <= 0xFFFF ? 2 :
299 elapsed_time <= 0xFFFFFF ? 3 : 4;
300} 297}
301 298
302void dccp_insert_option_elapsed_time(struct sock *sk, 299void dccp_insert_option_elapsed_time(struct sock *sk,