mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
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
This commit is contained in:
parent
f06581392e
commit
c26b098bf4
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user