From 234b68607006f3721679e900809ccb99e8bfb10c Mon Sep 17 00:00:00 2001 From: Ilpo Järvinen Date: Sun, 2 Dec 2007 00:48:02 +0200 Subject: [TCP]: Add tcp_for_write_queue_from_safe and use it in mtu_probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ilpo Järvinen Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- net/ipv4/tcp_output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'net/ipv4/tcp_output.c') diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index b41176f380d7..7d8583a15d02 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); -- cgit v1.2.3-58-ga151