Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74221
b: refs/heads/master
c: 91cc17c
h: refs/heads/master
i:
  74219: 4dc3de6
v: v3
  • Loading branch information
Ilpo Järvinen authored and Herbert Xu committed Nov 23, 2007
1 parent 1f03ae9 commit a61e510
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88c07ddec8c5e06aa331470076af27a397fc0993
refs/heads/master: 91cc17c0e5e5ada156a8d5787a2509d263ea6bbf
17 changes: 8 additions & 9 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ static int tcp_mtu_probe(struct sock *sk)
struct sk_buff *skb, *nskb, *next;
int len;
int probe_size;
int size_needed;
unsigned int pif;
int copy;
int mss_now;
Expand All @@ -1313,6 +1314,7 @@ static int tcp_mtu_probe(struct sock *sk)
/* Very simple search strategy: just double the MSS. */
mss_now = tcp_current_mss(sk, 0);
probe_size = 2*tp->mss_cache;
size_needed = probe_size + (tp->reordering + 1) * tp->mss_cache;
if (probe_size > tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_high)) {
/* TODO: set timer for probe_converge_event */
return -1;
Expand All @@ -1322,18 +1324,15 @@ static int tcp_mtu_probe(struct sock *sk)
len = 0;
if ((skb = tcp_send_head(sk)) == NULL)
return -1;
while ((len += skb->len) < probe_size && !tcp_skb_is_last(sk, skb))
while ((len += skb->len) < size_needed && !tcp_skb_is_last(sk, skb))
skb = tcp_write_queue_next(sk, skb);
if (len < probe_size)
if (len < size_needed)
return -1;

/* Receive window check. */
if (after(TCP_SKB_CB(skb)->seq + probe_size, tp->snd_una + tp->snd_wnd)) {
if (tp->snd_wnd < probe_size)
return -1;
else
return 0;
}
if (tp->snd_wnd < size_needed)
return -1;
if (after(tp->snd_nxt + size_needed, tp->snd_una + tp->snd_wnd))
return 0;

/* Do we need to wait to drain cwnd? */
pif = tcp_packets_in_flight(tp);
Expand Down

0 comments on commit a61e510

Please sign in to comment.