Message ID | 20220610034204.67901-4-imagedong@tencent.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: tcp: add skb drop reasons to tcp state change | expand |
diff --git a/include/net/dropreason.h b/include/net/dropreason.h index fae9b40e54fa..3c6f1e299c35 100644 --- a/include/net/dropreason.h +++ b/include/net/dropreason.h @@ -231,6 +231,11 @@ enum skb_drop_reason { * MTU) */ SKB_DROP_REASON_PKT_TOO_BIG, + /** + * @SKB_DROP_REASON_SOCKET_DESTROYED: socket is destroyed and the + * skb in its receive or send queue are all dropped + */ + SKB_DROP_REASON_SOCKET_DESTROYED, /** * @SKB_DROP_REASON_MAX: the maximum of drop reason, which shouldn't be * used as a real 'reason' diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index c0b7e6c21360..1812060f24cb 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -1129,7 +1129,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);