Skip to content

Commit c26b098

Browse files
q2venMartin KaFai Lau
authored andcommitted
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
1 parent f065813 commit c26b098

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/core/filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12021,7 +12021,7 @@ BPF_CALL_1(bpf_skc_to_unix_sock, struct sock *, sk)
1202112021
* trigger an explicit type generation here.
1202212022
*/
1202312023
BTF_TYPE_EMIT(struct unix_sock);
12024-
if (sk && sk_fullsock(sk) && sk->sk_family == AF_UNIX)
12024+
if (sk && sk_is_unix(sk))
1202512025
return (unsigned long)sk;
1202612026

1202712027
return (unsigned long)NULL;

0 commit comments

Comments
 (0)