[TCP]: Wrap-safed reordering detection FRTO check
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Mon, 1 Oct 2007 22:28:48 +0000 (15:28 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:54:00 +0000 (16:54 -0700)
In case somebody has a suggestion about a better place for this
check, which must guarantee execution "early enough" (i.e,
before the wrap can occur), I'm very open to them.

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

index c1339d88bbf38c18dacc5603a5e0962ac59611c7..7c1a92ffa0839b9c51183d1b449e665bb1c41863 100644 (file)
@@ -3027,6 +3027,9 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
        /* See if we can take anything off of the retransmit queue. */
        flag |= tcp_clean_rtx_queue(sk, &seq_rtt);
 
+       /* Guarantee sacktag reordering detection against wrap-arounds */
+       if (before(tp->frto_highmark, tp->snd_una))
+               tp->frto_highmark = 0;
        if (tp->frto_counter)
                frto_cwnd = tcp_process_frto(sk, flag);