diff options
| author | Gabriel Krisman Bertazi <krisman@suse.de> | 2025-11-25 16:17:59 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-11-26 13:45:23 -0700 |
| commit | 4677e78800bbde62a9edce0eb3b40c775ec55e0d (patch) | |
| tree | a23b07bf6aed503561746a12f11744318c340d52 /net/compat.c | |
| parent | 1e93de9205b4d5c0f06507e9e1c398574a07fb80 (diff) | |
| download | tip-4677e78800bbde62a9edce0eb3b40c775ec55e0d.tar.gz | |
socket: Unify getsockname and getpeername implementation
They are already implemented by the same get_name hook in the protocol
level. Bring the unification one level up to reduce code duplication
in preparation to supporting these as io_uring operations.
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'net/compat.c')
| -rw-r--r-- | net/compat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/compat.c b/net/compat.c index 485db8ee9b28fd..2c9bd0edac997b 100644 --- a/net/compat.c +++ b/net/compat.c @@ -460,10 +460,10 @@ COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args) ret = __sys_accept4(a0, compat_ptr(a1), compat_ptr(a[2]), 0); break; case SYS_GETSOCKNAME: - ret = __sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2])); + ret = __sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2]), 0); break; case SYS_GETPEERNAME: - ret = __sys_getpeername(a0, compat_ptr(a1), compat_ptr(a[2])); + ret = __sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2]), 1); break; case SYS_SOCKETPAIR: ret = __sys_socketpair(a0, a1, a[2], compat_ptr(a[3])); |
