diff options
| author | Jori Koolstra <jkoolstra@xs4all.nl> | 2026-08-13 12:28:16 -0400 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-17 18:14:52 -0700 |
| commit | 48b84acc5e18655f2a02fe2a043330d03f939ffe (patch) | |
| tree | 31015ccb60e0a0082d8406a095ea5672e71fe4db /net/core | |
| parent | de1c489b57c11fabc766aeb6777ed5b0038fa3bb (diff) | |
net: scm: move scm_detach_fds() from common path to scm_recv_unix()
scm->fp can only be set when using UNIX sockets, therefore we should
move it out of the common path __scm_recv_common() into
scm_recv_unix().
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
Link: https://patch.msgid.link/20260813162818.149248-3-jkoolstra@xs4all.nl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/scm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/scm.c b/net/core/scm.c index eec13f50ecaf..a73b1eb30fd2 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -523,9 +523,6 @@ static bool __scm_recv_common(struct sock *sk, struct msghdr *msg, scm_passec(sk, msg, scm); - if (scm->fp) - scm_detach_fds(msg, scm); - return true; } @@ -545,6 +542,9 @@ void scm_recv_unix(struct socket *sock, struct msghdr *msg, if (!__scm_recv_common(sock->sk, msg, scm, flags)) return; + if (scm->fp) + scm_detach_fds(msg, scm); + if (sock->sk->sk_scm_pidfd) scm_pidfd_recv(msg, scm); |
