diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-12-06 01:43:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-06 01:43:26 -0500 |
commit | 41834b7332a1ad3f7b6e8bbd83e6ce63586f0b07 (patch) | |
tree | 29932203c8bc1ef4a90a9dbabab205699c4c1263 /net/ipv4/tcp_input.c | |
parent | ee6aac59505bcae5de1422c76956de62ac22170d (diff) |
tcp: share code through function, not through copy-paste. :-)
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 215e38c1a233..99b7ecbe8893 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -3052,6 +3052,13 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag) | |||
3052 | tcp_xmit_retransmit_queue(sk); | 3052 | tcp_xmit_retransmit_queue(sk); |
3053 | } | 3053 | } |
3054 | 3054 | ||
3055 | static void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt) | ||
3056 | { | ||
3057 | tcp_rtt_estimator(sk, seq_rtt); | ||
3058 | tcp_set_rto(sk); | ||
3059 | inet_csk(sk)->icsk_backoff = 0; | ||
3060 | } | ||
3061 | |||
3055 | /* Read draft-ietf-tcplw-high-performance before mucking | 3062 | /* Read draft-ietf-tcplw-high-performance before mucking |
3056 | * with this code. (Supersedes RFC1323) | 3063 | * with this code. (Supersedes RFC1323) |
3057 | */ | 3064 | */ |
@@ -3073,10 +3080,8 @@ static void tcp_ack_saw_tstamp(struct sock *sk, int flag) | |||
3073 | * in window is lost... Voila. --ANK (010210) | 3080 | * in window is lost... Voila. --ANK (010210) |
3074 | */ | 3081 | */ |
3075 | struct tcp_sock *tp = tcp_sk(sk); | 3082 | struct tcp_sock *tp = tcp_sk(sk); |
3076 | const __u32 seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr; | 3083 | |
3077 | tcp_rtt_estimator(sk, seq_rtt); | 3084 | tcp_valid_rtt_meas(sk, tcp_time_stamp - tp->rx_opt.rcv_tsecr); |
3078 | tcp_set_rto(sk); | ||
3079 | inet_csk(sk)->icsk_backoff = 0; | ||
3080 | } | 3085 | } |
3081 | 3086 | ||
3082 | static void tcp_ack_no_tstamp(struct sock *sk, u32 seq_rtt, int flag) | 3087 | static void tcp_ack_no_tstamp(struct sock *sk, u32 seq_rtt, int flag) |
@@ -3093,9 +3098,7 @@ static void tcp_ack_no_tstamp(struct sock *sk, u32 seq_rtt, int flag) | |||
3093 | if (flag & FLAG_RETRANS_DATA_ACKED) | 3098 | if (flag & FLAG_RETRANS_DATA_ACKED) |
3094 | return; | 3099 | return; |
3095 | 3100 | ||
3096 | tcp_rtt_estimator(sk, seq_rtt); | 3101 | tcp_valid_rtt_meas(sk, seq_rtt); |
3097 | tcp_set_rto(sk); | ||
3098 | inet_csk(sk)->icsk_backoff = 0; | ||
3099 | } | 3102 | } |
3100 | 3103 | ||
3101 | static inline void tcp_ack_update_rtt(struct sock *sk, const int flag, | 3104 | static inline void tcp_ack_update_rtt(struct sock *sk, const int flag, |