From: Ilpo Järvinen Date: Sat, 19 May 2007 20:56:57 +0000 (-0700) Subject: [TCP] FRTO: Prevent state inconsistency in corner cases X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=580e572a4a1bfea2f42af63ba4785ac7dfbcb45d;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [TCP] FRTO: Prevent state inconsistency in corner cases State could become inconsistent in two cases: 1) Userspace disabled FRTO by tuning sysctl when one of the TCP flows was in the middle of FRTO algorithm (and then RTO is again triggered) 2) SACK reneging occurs during FRTO algorithm A simple solution is just to abort the previous FRTO when such obscure condition occurs... Signed-off-by: Ilpo Järvinen Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 7ecdc89229e8..38cb25b48bf3 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1501,6 +1501,8 @@ void tcp_enter_loss(struct sock *sk, int how) tcp_set_ca_state(sk, TCP_CA_Loss); tp->high_seq = tp->snd_nxt; TCP_ECN_queue_cwr(tp); + /* Abort FRTO algorithm if one is in progress */ + tp->frto_counter = 0; clear_all_retrans_hints(tp); }