[RAMEN9610-21380]tcp: Clear sk_send_head after purGing the write queue
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / include / net / tcp.h
index a307f830d9c49ed3026b8fd842abb91aac38a01d..70201399ad13115088c4e14225361b210435ad3d 100644 (file)
@@ -1611,6 +1611,8 @@ static inline void tcp_init_send_head(struct sock *sk)
        sk->sk_send_head = NULL;
 }
 
+static inline void tcp_init_send_head(struct sock *sk);
+
 /* write queue abstraction */
 static inline void tcp_write_queue_purge(struct sock *sk)
 {
@@ -1619,10 +1621,12 @@ static inline void tcp_write_queue_purge(struct sock *sk)
        tcp_chrono_stop(sk, TCP_CHRONO_BUSY);
        while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL)
                sk_wmem_free_skb(sk, skb);
+       tcp_init_send_head(sk);
        sk_mem_reclaim(sk);
        tcp_clear_all_retrans_hints(tcp_sk(sk));
        tcp_init_send_head(sk);
        tcp_sk(sk)->packets_out = 0;
+       inet_csk(sk)->icsk_backoff = 0;
 }
 
 static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk)