summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@google.com>2026-02-03 21:30:07 +0000
committerMartin KaFai Lau <martin.lau@kernel.org>2026-02-04 09:36:06 -0800
commitc26b098bf42c71111ca976ce330ea5c66b9a5d8e (patch)
treeeb3d2fc4d42d5f1b9433d015e3f037d12892d3d8 /net
parentf06581392e9d56ac86d8fcc29c0931441ee82f4a (diff)
bpf: Don't check sk_fullsock() in bpf_skc_to_unix_sock().
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(). Acked-by: Stanislav Fomichev <sdf@fomichev.me> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20260203213442.682838-3-kuniyu@google.com
Diffstat (limited to 'net')
-rw-r--r--net/core/filter.c2
1 files changed, 1 insertions, 1 deletions
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;