aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-11-23 06:10:56 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2007-11-23 06:10:56 -0500
commit7f9c33e515353ea91afc62341161fead19e78567 (patch)
tree3491ab469f790f6c5538de6e24e93c7bbe6a84b1 /net/ipv4/tcp_output.c
parent91cc17c0e5e5ada156a8d5787a2509d263ea6bbf (diff)
[TCP] MTUprobe: Cleanup send queue check (no need to loop)
The original code has striking complexity to perform a query which can be reduced to a very simple compare. FIN seqno may be included to write_seq but it should not make any significant difference here compared to skb->len which was used previously. One won't end up there with SYN still queued. Use of write_seq check guarantees that there's a valid skb in send_head so I removed the extra check. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Acked-by: John Heffner <jheffner@psc.edu> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 4f8a8a17891a..e5130a7fe181 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1321,12 +1321,7 @@ static int tcp_mtu_probe(struct sock *sk)
1321 } 1321 }
1322 1322
1323 /* Have enough data in the send queue to probe? */ 1323 /* Have enough data in the send queue to probe? */
1324 len = 0; 1324 if (tp->write_seq - tp->snd_nxt < size_needed)
1325 if ((skb = tcp_send_head(sk)) == NULL)
1326 return -1;
1327 while ((len += skb->len) < size_needed && !tcp_skb_is_last(sk, skb))
1328 skb = tcp_write_queue_next(sk, skb);
1329 if (len < size_needed)
1330 return -1; 1325 return -1;
1331 1326
1332 if (tp->snd_wnd < size_needed) 1327 if (tp->snd_wnd < size_needed)