Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8279
b: refs/heads/master
c: 1c14ac0
h: refs/heads/master
i:
  8277: 3081042
  8275: d6d1e3a
  8271: dedcde2
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Sep 9, 2005
1 parent 6d7e760 commit 7dc8442
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 27ae543e6f116df66e2b19ff0a3aa1053e4784d8
refs/heads/master: 1c14ac0ae8eb62cbb40af1e31b156994c7d7d3d5
34 changes: 18 additions & 16 deletions trunk/net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
struct dccp_options_received *opt_recv = &dp->dccps_options_received;
unsigned char opt, len;
unsigned char *value;
u32 elapsed_time;

memset(opt_recv, 0, sizeof(*opt_recv));

Expand Down Expand Up @@ -159,18 +160,18 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
(unsigned long long)
DCCP_SKB_CB(skb)->dccpd_ack_seq);

if (len > 4) {
if (len == 6)
opt_recv->dccpor_elapsed_time =
ntohs(*(u16 *)(value + 4));
else
opt_recv->dccpor_elapsed_time =
ntohl(*(u32 *)(value + 4));

dccp_pr_debug("%sTIMESTAMP_ECHO ELAPSED_TIME=%d\n",
debug_prefix,
opt_recv->dccpor_elapsed_time);
}
if (len == 4)
break;

if (len == 6)
elapsed_time = ntohs(*(u16 *)(value + 4));
else
elapsed_time = ntohl(*(u32 *)(value + 4));

/* Give precedence to the biggest ELAPSED_TIME */
if (elapsed_time > opt_recv->dccpor_elapsed_time)
opt_recv->dccpor_elapsed_time = elapsed_time;
break;
case DCCPO_ELAPSED_TIME:
if (len != 2 && len != 4)
Expand All @@ -180,14 +181,15 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
continue;

if (len == 2)
opt_recv->dccpor_elapsed_time =
ntohs(*(u16 *)value);
elapsed_time = ntohs(*(u16 *)value);
else
opt_recv->dccpor_elapsed_time =
ntohl(*(u32 *)value);
elapsed_time = ntohl(*(u32 *)value);

if (elapsed_time > opt_recv->dccpor_elapsed_time)
opt_recv->dccpor_elapsed_time = elapsed_time;

dccp_pr_debug("%sELAPSED_TIME=%d\n", debug_prefix,
opt_recv->dccpor_elapsed_time);
elapsed_time);
break;
/*
* From draft-ietf-dccp-spec-11.txt:
Expand Down

0 comments on commit 7dc8442

Please sign in to comment.