@@ -548,6 +548,10 @@ struct sk_buff;
*
* SKB_DROP_REASON_PKT_TOO_BIG
* packet size is too big (maybe exceed the MTU)
+ *
+ * SKB_DROP_REASON_SOCKET_DESTROYED
+ * socket is destroyed and the skb in its receive or send queue
+ * are all dropped
*/
#define __DEFINE_SKB_DROP_REASON(FN) \
FN(NOT_SPECIFIED) \
@@ -614,6 +618,7 @@ struct sk_buff;
FN(IP_INADDRERRORS) \
FN(IP_INNOROUTES) \
FN(PKT_TOO_BIG) \
+ FN(SOCKET_DESTROYED) \
FN(MAX)
/* The reason of skb drop, which is used in kfree_skb_reason().
@@ -1006,7 +1006,7 @@ void inet_csk_destroy_sock(struct sock *sk)
sk->sk_prot->destroy(sk);
- sk_stream_kill_queues(sk);
+ sk_stream_kill_queues_reason(sk, SKB_DROP_REASON_SOCKET_DESTROYED);
xfrm_sk_free_policy(sk);