aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-03-20 14:27:17 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:02 -0400
commit89560b53b92a07c529e13a462aa7fd87a844f1f5 (patch)
tree89409bee68da1ee44b7945315efecd779d7fe60a
parent7dfee1a9c07f80a82aa5fbad340146f2b5c794b4 (diff)
[DCCP]: Sample RTT from SYN exchange
Function:
-rw-r--r--include/linux/dccp.h2
-rw-r--r--net/dccp/input.c8
-rw-r--r--net/dccp/options.c8
3 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index fdd4217f1047..e668cf531bab 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -481,10 +481,12 @@ struct dccp_ackvec;
481 * @dccps_hc_rx_insert_options - 481 * @dccps_hc_rx_insert_options -
482 * @dccps_hc_tx_insert_options - 482 * @dccps_hc_tx_insert_options -
483 * @dccps_xmit_timer - timer for when CCID is not ready to send 483 * @dccps_xmit_timer - timer for when CCID is not ready to send
484 * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
484 */ 485 */
485struct dccp_sock { 486struct dccp_sock {
486 /* inet_connection_sock has to be the first member of dccp_sock */ 487 /* inet_connection_sock has to be the first member of dccp_sock */
487 struct inet_connection_sock dccps_inet_connection; 488 struct inet_connection_sock dccps_inet_connection;
489#define dccps_syn_rtt dccps_inet_connection.icsk_ack.lrcvtime
488 __u64 dccps_swl; 490 __u64 dccps_swl;
489 __u64 dccps_swh; 491 __u64 dccps_swh;
490 __u64 dccps_awl; 492 __u64 dccps_awl;
diff --git a/net/dccp/input.c b/net/dccp/input.c
index bd578c87b2e7..da6ec185ed5b 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -300,6 +300,14 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
300 if (dccp_parse_options(sk, skb)) 300 if (dccp_parse_options(sk, skb))
301 goto out_invalid_packet; 301 goto out_invalid_packet;
302 302
303 /* Obtain RTT sample from SYN exchange (used by CCID 3) */
304 if (dp->dccps_options_received.dccpor_timestamp_echo) {
305 struct timeval now;
306
307 dccp_timestamp(sk, &now);
308 dp->dccps_syn_rtt = dccp_sample_rtt(sk, &now, NULL);
309 }
310
303 if (dccp_msk(sk)->dccpms_send_ack_vector && 311 if (dccp_msk(sk)->dccpms_send_ack_vector &&
304 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, 312 dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk,
305 DCCP_SKB_CB(skb)->dccpd_seq, 313 DCCP_SKB_CB(skb)->dccpd_seq,
diff --git a/net/dccp/options.c b/net/dccp/options.c
index 9074ca7977b2..14b621227323 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -563,6 +563,14 @@ int dccp_insert_options(struct sock *sk, struct sk_buff *skb)
563 dccp_insert_options_feat(sk, skb)) 563 dccp_insert_options_feat(sk, skb))
564 return -1; 564 return -1;
565 565
566 /*
567 * Obtain RTT sample from Request/Response exchange.
568 * This is currently used in CCID 3 initialisation.
569 */
570 if (DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_REQUEST &&
571 dccp_insert_option_timestamp(sk, skb))
572 return -1;
573
566 /* XXX: insert other options when appropriate */ 574 /* XXX: insert other options when appropriate */
567 575
568 if (DCCP_SKB_CB(skb)->dccpd_opt_len != 0) { 576 if (DCCP_SKB_CB(skb)->dccpd_opt_len != 0) {