Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=234b68607006f3721679e900809ccb99e8bfb10c
Commit:     234b68607006f3721679e900809ccb99e8bfb10c
Parent:     d67c58e9ae80ea577785111534e49d3ca757ec50
Author:     Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Sun Dec 2 00:48:02 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:55:43 2008 -0800

    [TCP]: Add tcp_for_write_queue_from_safe and use it in mtu_probe
    
    Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/tcp.h     |    5 +++++
 net/ipv4/tcp_output.c |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index cdd0050..6e392ba 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1229,6 +1229,11 @@ static inline struct sk_buff 
*tcp_write_queue_next(struct sock *sk, struct sk_bu
                for (; (skb != (struct sk_buff *)&(sk)->sk_write_queue);\
                     skb = skb->next)
 
+#define tcp_for_write_queue_from_safe(skb, tmp, sk)                    \
+               for (tmp = skb->next;                                   \
+                    (skb != (struct sk_buff *)&(sk)->sk_write_queue);  \
+                    skb = tmp, tmp = skb->next)
+
 static inline struct sk_buff *tcp_send_head(struct sock *sk)
 {
        return sk->sk_send_head;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index b41176f..7d8583a 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1350,9 +1350,7 @@ static int tcp_mtu_probe(struct sock *sk)
        tcp_insert_write_queue_before(nskb, skb, sk);
 
        len = 0;
-       while (len < probe_size) {
-               next = tcp_write_queue_next(sk, skb);
-
+       tcp_for_write_queue_from_safe(skb, next, sk) {
                copy = min_t(int, skb->len, probe_size - len);
                if (nskb->ip_summed)
                        skb_copy_bits(skb, 0, skb_put(nskb, copy), copy);
@@ -1381,7 +1379,9 @@ static int tcp_mtu_probe(struct sock *sk)
                }
 
                len += copy;
-               skb = next;
+
+               if (len >= probe_size)
+                       break;
        }
        tcp_init_tso_segs(sk, nskb, nskb->len);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to