diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 437bb7ceba7f..8e08b409c71e 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2823,8 +2823,10 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) | |||
2823 | return -EBUSY; | 2823 | return -EBUSY; |
2824 | 2824 | ||
2825 | if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { | 2825 | if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { |
2826 | if (before(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) | 2826 | if (unlikely(before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))) { |
2827 | BUG(); | 2827 | WARN_ON_ONCE(1); |
2828 | return -EINVAL; | ||
2829 | } | ||
2828 | if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) | 2830 | if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) |
2829 | return -ENOMEM; | 2831 | return -ENOMEM; |
2830 | } | 2832 | } |
@@ -3332,6 +3334,7 @@ static void tcp_connect_init(struct sock *sk) | |||
3332 | sock_reset_flag(sk, SOCK_DONE); | 3334 | sock_reset_flag(sk, SOCK_DONE); |
3333 | tp->snd_wnd = 0; | 3335 | tp->snd_wnd = 0; |
3334 | tcp_init_wl(tp, 0); | 3336 | tcp_init_wl(tp, 0); |
3337 | tcp_write_queue_purge(sk); | ||
3335 | tp->snd_una = tp->write_seq; | 3338 | tp->snd_una = tp->write_seq; |
3336 | tp->snd_sml = tp->write_seq; | 3339 | tp->snd_sml = tp->write_seq; |
3337 | tp->snd_up = tp->write_seq; | 3340 | tp->snd_up = tp->write_seq; |