Fixes NewReno breakage that got introduced because reno ended up
into RFC3517 counting branch in tcp_mark_head_lost after the
split space tweaks. The fack branch would have worked, however,
coming lost marker updates would eventually add this anyway.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index f1eee2d..e410c21 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2120,6 +2120,21 @@ static void tcp_verify_retransmit_hint(struct tcp_sock 
*tp,
                tp->retransmit_skb_hint = NULL;
 }
 
+/* Simple NewReno thing: Mark head LOST if it wasn't yet and it's below
+ * high_seq, stop. That's all.
+ */
+static void tcp_mark_head_lost_single(struct sock *sk)
+{
+       struct tcp_sock *tp = tcp_sk(sk);
+       struct sk_buff *skb = tcp_write_queue_head(sk);
+
+       if (!(TCP_SKB_CB(skb)->sacked & TCPCB_LOST) &&
+           before(tp->snd_una, tp->high_seq)) {
+               TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
+               tp->lost_out += tcp_skb_pcount(skb);
+       }
+}
+
 /* Mark head of queue up as lost. With RFC3517 SACK, the packets is
  * is against sacked "cnt", otherwise it's against facked "cnt"
  */
@@ -2172,7 +2187,6 @@ static void tcp_mark_head_lost(struct sock *sk, int 
packets, int fast_rexmit)
                        tcp_verify_retransmit_hint(tp, skb);
                }
        }
-       tcp_verify_left_out(tp);
 }
 
 /* Account newly detected lost packet(s) */
@@ -2182,7 +2196,7 @@ static void tcp_update_scoreboard(struct sock *sk, int 
fast_rexmit)
        struct tcp_sock *tp = tcp_sk(sk);
 
        if (tcp_is_reno(tp)) {
-               tcp_mark_head_lost(sk, 1, fast_rexmit);
+               tcp_mark_head_lost_single(sk);
        } else if (tcp_is_fack(tp)) {
                int lost = tp->fackets_out - tp->reordering;
                if (lost <= 0)
@@ -2195,6 +2209,8 @@ static void tcp_update_scoreboard(struct sock *sk, int 
fast_rexmit)
                tcp_mark_head_lost(sk, sacked_upto, fast_rexmit);
        }
 
+       tcp_verify_left_out(tp);
+
        /* New heuristics: it is possible only after we switched
         * to restart timer each time when something is ACKed.
         * Hence, we can detect timed out packets during fast
-- 
1.5.0.6

Reply via email to