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 383cac0ff0ec..d07e34f8e309 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2833,8 +2833,10 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) | |||
2833 | return -EBUSY; | 2833 | return -EBUSY; |
2834 | 2834 | ||
2835 | if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { | 2835 | if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { |
2836 | if (before(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) | 2836 | if (unlikely(before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))) { |
2837 | BUG(); | 2837 | WARN_ON_ONCE(1); |
2838 | return -EINVAL; | ||
2839 | } | ||
2838 | if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) | 2840 | if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) |
2839 | return -ENOMEM; | 2841 | return -ENOMEM; |
2840 | } | 2842 | } |
@@ -3342,6 +3344,7 @@ static void tcp_connect_init(struct sock *sk) | |||
3342 | sock_reset_flag(sk, SOCK_DONE); | 3344 | sock_reset_flag(sk, SOCK_DONE); |
3343 | tp->snd_wnd = 0; | 3345 | tp->snd_wnd = 0; |
3344 | tcp_init_wl(tp, 0); | 3346 | tcp_init_wl(tp, 0); |
3347 | tcp_write_queue_purge(sk); | ||
3345 | tp->snd_una = tp->write_seq; | 3348 | tp->snd_una = tp->write_seq; |
3346 | tp->snd_sml = tp->write_seq; | 3349 | tp->snd_sml = tp->write_seq; |
3347 | tp->snd_up = tp->write_seq; | 3350 | tp->snd_up = tp->write_seq; |