]>
Commit | Line | Data |
---|---|---|
a82817d0 GKH |
1 | From 598856407d4e20ebb4de01a91a93d89325924d43 Mon Sep 17 00:00:00 2001 |
2 | From: Damian Lukowski <damian@tvk.rwth-aachen.de> | |
3 | Date: Wed, 10 Feb 2010 18:04:08 -0800 | |
4 | Subject: tcp: fix ICMP-RTO war | |
5 | ||
6 | From: Damian Lukowski <damian@tvk.rwth-aachen.de> | |
7 | ||
8 | commit 598856407d4e20ebb4de01a91a93d89325924d43 upstream. | |
9 | ||
10 | Make sure, that TCP has a nonzero RTT estimation after three-way | |
11 | handshake. Currently, a listening TCP has a value of 0 for srtt, | |
12 | rttvar and rto right after the three-way handshake is completed | |
13 | with TCP timestamps disabled. | |
14 | This will lead to corrupt RTO recalculation and retransmission | |
15 | flood when RTO is recalculated on backoff reversion as introduced | |
16 | in "Revert RTO on ICMP destination unreachable" | |
17 | (f1ecd5d9e7366609d640ff4040304ea197fbc618). | |
18 | This behaviour can be provoked by connecting to a server which | |
19 | "responds first" (like SMTP) and rejecting every packet after | |
20 | the handshake with dest-unreachable, which will lead to softirq | |
21 | load on the server (up to 30% per socket in some tests). | |
22 | ||
23 | Thanks to Ilpo Jarvinen for providing debug patches and to | |
24 | Denys Fedoryshchenko for reporting and testing. | |
25 | ||
26 | Changes since v3: Removed bad characters in patchfile. | |
27 | ||
28 | Reported-by: Denys Fedoryshchenko <denys@visp.net.lb> | |
29 | Signed-off-by: Damian Lukowski <damian@tvk.rwth-aachen.de> | |
30 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
31 | Cc: maximilian attems <max@stro.at> | |
32 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
33 | ||
34 | --- | |
35 | net/ipv4/tcp_input.c | 6 ++---- | |
36 | 1 file changed, 2 insertions(+), 4 deletions(-) | |
37 | ||
38 | --- a/net/ipv4/tcp_input.c | |
39 | +++ b/net/ipv4/tcp_input.c | |
40 | @@ -5699,11 +5699,9 @@ int tcp_rcv_state_process(struct sock *s | |
41 | ||
42 | /* tcp_ack considers this ACK as duplicate | |
43 | * and does not calculate rtt. | |
44 | - * Fix it at least with timestamps. | |
45 | + * Force it here. | |
46 | */ | |
47 | - if (tp->rx_opt.saw_tstamp && | |
48 | - tp->rx_opt.rcv_tsecr && !tp->srtt) | |
49 | - tcp_ack_saw_tstamp(sk, 0); | |
50 | + tcp_ack_update_rtt(sk, 0, 0); | |
51 | ||
52 | if (tp->rx_opt.tstamp_ok) | |
53 | tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; |