Skip to content

Commit

Permalink
[DCCP]: Debug statements for Elapsed Time option
Browse files Browse the repository at this point in the history
This prints the value of the parsed Elapsed Time when received via a
Timestamp Echo option [RFC 4342, 13.3].

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Apr 26, 2007
1 parent b2449fd commit f73f709
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,25 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
opt_recv->dccpor_timestamp_echo = ntohl(*(__be32 *)value);

dccp_pr_debug("%s rx opt: TIMESTAMP_ECHO=%u, len=%d, "
"ackno=%llu, ", dccp_role(sk),
"ackno=%llu", dccp_role(sk),
opt_recv->dccpor_timestamp_echo,
len + 2,
(unsigned long long)
DCCP_SKB_CB(skb)->dccpd_ack_seq);


if (len == 4)
if (len == 4) {
dccp_pr_debug_cat("\n");
break;
}

if (len == 6)
elapsed_time = ntohs(*(__be16 *)(value + 4));
else
elapsed_time = ntohl(*(__be32 *)(value + 4));

dccp_pr_debug_cat(", ELAPSED_TIME=%d\n", elapsed_time);

/* Give precedence to the biggest ELAPSED_TIME */
if (elapsed_time > opt_recv->dccpor_elapsed_time)
opt_recv->dccpor_elapsed_time = elapsed_time;
Expand Down

0 comments on commit f73f709

Please sign in to comment.