]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
TCP: Fix TCP handling of SACK in bidirectional flows.
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Wed, 22 Aug 2007 04:18:07 +0000 (21:18 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 31 Aug 2007 06:01:51 +0000 (23:01 -0700)
It's possible that new SACK blocks that should trigger new LOST
markings arrive with new data (which previously made is_dupack
false). In addition, I think this fixes a case where we get
a cumulative ACK with enough SACK blocks to trigger the fast
recovery (is_dupack would be false there too).

I'm not completely pleased with this solution because readability
of the code is somewhat questionable as 'is_dupack' in SACK case
is no longer about dupacks only but would mean something like
'lost_marker_work_todo' too... But because of Eifel stuff done
in CA_Recovery, the FLAG_DATA_SACKED check cannot be placed to
the if statement which seems attractive solution. Nevertheless,
I didn't like adding another variable just for that either... :-)

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/tcp_input.c

index aea4b55bac2b2bad12bc26615e874c6ac13e94e5..13abf4eaa051311ba0283749a35205cd99ddb503 100644 (file)
@@ -2112,7 +2112,10 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
 {
        struct inet_connection_sock *icsk = inet_csk(sk);
        struct tcp_sock *tp = tcp_sk(sk);
-       int is_dupack = (tp->snd_una == prior_snd_una && !(flag&FLAG_NOT_DUP));
+       int is_dupack = (tp->snd_una == prior_snd_una &&
+                        (!(flag&FLAG_NOT_DUP) ||
+                         ((flag&FLAG_DATA_SACKED) &&
+                          (tp->fackets_out > tp->reordering))));
 
        /* Some technical things:
         * 1. Reno does not count dupacks (sacked_out) automatically. */