AF_UNIX does not use TCP_NEW_SYN_RECV nor TCP_TIME_WAIT and checking sk->sk_family is sufficient. Let's remove sk_fullsock() and use sk_is_unix() in bpf_skc_to_unix_sock(). Signed-off-by: Kuniyuki Iwashima --- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/filter.c b/net/core/filter.c index f04982d79d72..90bfe5a6c1db 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -12021,7 +12021,7 @@ BPF_CALL_1(bpf_skc_to_unix_sock, struct sock *, sk) * trigger an explicit type generation here. */ BTF_TYPE_EMIT(struct unix_sock); - if (sk && sk_fullsock(sk) && sk->sk_family == AF_UNIX) + if (sk && sk_is_unix(sk)) return (unsigned long)sk; return (unsigned long)NULL; -- 2.53.0.rc2.204.g2597b5adb4-goog