From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= <[EMAIL PROTECTED]>

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

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8a02de2..cc61916 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1328,12 +1328,16 @@ static int tcp_sacktag_one(struct sk_buff *skb, struct 
sock *sk,
 static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
                                        struct tcp_sack_block *next_dup,
                                        u32 start_seq, u32 end_seq,
-                                       int dup_sack_in, int *fack_count,
-                                       int *reord, int *flag)
+                                       int dup_sack_in, int *reord, int *flag)
 {
+       unsigned int fack_count_base;
+
+       fack_count_base = TCP_SKB_CB(tcp_write_queue_head(sk))->fack_count;
+
        tcp_for_write_queue_from(skb, sk, 0) {
                int in_sack = 0;
                int dup_sack = dup_sack_in;
+               unsigned int fack_count;
 
                if (skb == tcp_send_head(sk))
                        break;
@@ -1356,10 +1360,10 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff 
*skb, struct sock *sk,
                if (unlikely(in_sack < 0))
                        break;
 
-               if (in_sack)
-                       *flag |= tcp_sacktag_one(skb, sk, reord, dup_sack, 
*fack_count);
-
-               *fack_count += tcp_skb_pcount(skb);
+               if (in_sack) {
+                       fack_count = TCP_SKB_CB(skb)->fack_count - 
fack_count_base;
+                       *flag |= tcp_sacktag_one(skb, sk, reord, dup_sack, 
fack_count);
+               }
        }
        return skb;
 }
@@ -1384,7 +1388,7 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct 
sk_buff *skb,
                                                struct sock *sk,
                                                struct tcp_sack_block *next_dup,
                                                u32 skip_to_seq,
-                                               int *fack_count, int *reord,
+                                               int *reord,
                                                int *flag)
 {
        if (next_dup == NULL)
@@ -1394,7 +1398,7 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct 
sk_buff *skb,
                skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq);
                tcp_sacktag_walk(skb, sk, NULL,
                                 next_dup->start_seq, next_dup->end_seq,
-                                1, fack_count, reord, flag);
+                                1, reord, flag);
        }
 
        return skb;
@@ -1421,7 +1425,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
        int reord = tp->packets_out;
        int flag = 0;
        int found_dup_sack = 0;
-       int fack_count;
        int i, j;
        int first_sack_index;
 
@@ -1499,7 +1502,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
        }
 
        skb = tcp_write_queue_head(sk);
-       fack_count = 0;
        i = 0;
 
        if (!tp->sacked_out) {
@@ -1540,7 +1542,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
                                skb = tcp_sacktag_skip(skb, sk, start_seq);
                                skb = tcp_sacktag_walk(skb, sk, next_dup, 
start_seq,
                                                       cache->start_seq, 
dup_sack,
-                                                      &fack_count, &reord, 
&flag);
+                                                      &reord, &flag);
                        }
 
                        /* Rest of the block already fully processed? */
@@ -1548,7 +1550,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
                                goto advance_sp;
 
                        skb = tcp_maybe_skipping_dsack(skb, sk, next_dup, 
cache->end_seq,
-                                                      &fack_count, &reord, 
&flag);
+                                                      &reord, &flag);
 
                        /* ...tail remains todo... */
                        if (tcp_highest_sack_seq(tp) == cache->end_seq) {
@@ -1556,7 +1558,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
                                skb = tcp_highest_sack(sk);
                                if (skb == NULL)
                                        break;
-                               fack_count = tp->fackets_out;
                                cache++;
                                goto walk;
                        }
@@ -1571,13 +1572,12 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
                        skb = tcp_highest_sack(sk);
                        if (skb == NULL)
                                break;
-                       fack_count = tp->fackets_out;
                }
                skb = tcp_sacktag_skip(skb, sk, start_seq);
 
 walk:
                skb = tcp_sacktag_walk(skb, sk, next_dup, start_seq, end_seq,
-                                      dup_sack, &fack_count, &reord, &flag);
+                                      dup_sack, &reord, &flag);
 
 advance_sp:
                /* SACK enhanced FRTO (RFC4138, Appendix B): Clearing correct
-- 
1.5.0.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to