|
@@ -2833,8 +2833,10 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
|
|
|
|
if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) {
|
|
if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) {
|
|
- if (before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))
|
|
|
|
- BUG();
|
|
|
|
|
|
+ if (unlikely(before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))) {
|
|
|
|
+ WARN_ON_ONCE(1);
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ }
|
|
if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq))
|
|
if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq))
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
@@ -3342,6 +3344,7 @@ static void tcp_connect_init(struct sock *sk)
|
|
sock_reset_flag(sk, SOCK_DONE);
|
|
sock_reset_flag(sk, SOCK_DONE);
|
|
tp->snd_wnd = 0;
|
|
tp->snd_wnd = 0;
|
|
tcp_init_wl(tp, 0);
|
|
tcp_init_wl(tp, 0);
|
|
|
|
+ tcp_write_queue_purge(sk);
|
|
tp->snd_una = tp->write_seq;
|
|
tp->snd_una = tp->write_seq;
|
|
tp->snd_sml = tp->write_seq;
|
|
tp->snd_sml = tp->write_seq;
|
|
tp->snd_up = tp->write_seq;
|
|
tp->snd_up = tp->write_seq;
|