From nobody Fri Jun 17 19:39:06 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A163B85BD18; Fri, 17 Jun 2022 19:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq9Q1j4Zz3R1q; Fri, 17 Jun 2022 19:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qbQMO3ztfpqnBMRpi4HzFiY5kARX9xPPJVu6GRC8J2k=; b=xdePrx5TclD7CPfYZShMvkDa1aSCwace0JPS7Evze3JFnoI1J5B/om5nAsXMvTnNy0PDBc EJhYsI/BsTvZnvg8rWEnNOZYDkzcgcnegAJJMt188DcRs+KRu3EmiQP5g06+GbYyDJTVQG dR3nwcrZ1SO4THG9iQ1HPU8CBCTPyMcpssj2ekg3e5FlG/v58SQbYI6pW0sNg08pw+Ir/C 8ZU4Ek7oxw62fOvCl4rEKapHHxkX+j8H18svC1vKcN6efMjKpK+GwKF2sYZvRIgFnDfv/9 YwFnFeMUq/A0yCQ0qDOQwZzvjWTtXv9zJTIXzKiS+Y2mL+qH+jh5Gp9KGlSwww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19845259C6; Fri, 17 Jun 2022 19:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJd610015559; Fri, 17 Jun 2022 19:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJd6KC015558; Fri, 17 Jun 2022 19:39:06 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:39:06 GMT Message-Id: <202206171939.25HJd6KC015558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 61337dfb340e - stable/13 - linux(4): Handle SO_DOMAIN in getsockopt syscall. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 61337dfb340ec87019aa512be7e6df4c026ee2c5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qbQMO3ztfpqnBMRpi4HzFiY5kARX9xPPJVu6GRC8J2k=; b=XD5gx8Zv6Bjt0HvPKuxHQDLVaOwnDzZuz5MTR4FcCgkR4jQ6YmSNGSqYtvZFH2MCuJQBKi 3gyxVhNFG1+avxuYZLbifb6qsZNV1ftsoieKrWrKdQTiuwkAq1q4gbRDPJmuGhGwDa5ywB jgTuv51QUVs36myTmAsDVtHkMcdpyTKOaQrMRr77h87frxPdJ4B973PPPgLCoqghpQCMF1 EXmzU08emdFnYkB6F27OjXQ/SBxVKKQ2he4jGz+Bk3blhSH0swfBSossPBbCZndqUdgZWw 8g1KadoROosJa+SFRoTtxGwcCfnyaDfH2THqIFqQAfVFNgcql+u1PZjaPUoZGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494746; a=rsa-sha256; cv=none; b=eERZzhGHGyTJ60DoS36hhGW/D95L4lE224i9BgM1Dit1zQmc7e/t6f+68Ratly3P/Nvhsz Fjl8ZL320drGZf30qYoPTnpjDBIJ3z7Vze9QKgXSWOw9ye9ET/amKM+nW/VoJFlYGs/6qO 3xHZbbyzC6cMSgkTZFJ2AF+WG2heXUB9wA9piLuX7sutuq3P5oNeqYOXQ8L7T/0B6qoHn2 GBRRqahuo/PmMy8HL9dwxRv9GtDqCrXRvN8/ORv7iGnQCj6G1USlHct6bfe9fOwLcOBIzd 9zNyh8hh4ZX2589bPb8B3v8puSm7AFCMjExxa/QqAY2NmlK4tEgo+7zdUCatmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=61337dfb340ec87019aa512be7e6df4c026ee2c5 commit 61337dfb340ec87019aa512be7e6df4c026ee2c5 Author: Dmitry Chagin AuthorDate: 2022-04-11 20:31:28 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:51 +0000 linux(4): Handle SO_DOMAIN in getsockopt syscall. Differential revision: https://reviews.freebsd.org/D34714 (cherry picked from commit cf312f799a867b4b1beef0536a162062659659a6) --- sys/compat/linux/linux_socket.c | 13 +++++++++++++ sys/compat/linux/linux_socket.h | 1 + 2 files changed, 14 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 935d07ecb7e0..4ba023daaba2 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -553,6 +553,8 @@ linux_to_bsd_so_sockopt(int opt) return (SO_ACCEPTCONN); case LINUX_SO_PROTOCOL: return (SO_PROTOCOL); + case LINUX_SO_DOMAIN: + return (SO_DOMAIN); } return (-1); } @@ -2008,6 +2010,17 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) newval = -bsd_to_linux_errno(newval); return (copyout(&newval, PTRIN(args->optval), len)); /* NOTREACHED */ + case SO_DOMAIN: + len = sizeof(newval); + error = kern_getsockopt(td, args->s, level, + name, &newval, UIO_SYSSPACE, &len); + if (error != 0) + return (error); + newval = bsd_to_linux_domain(newval); + if (newval == -1) + return (ENOPROTOOPT); + return (copyout(&newval, PTRIN(args->optval), len)); + /* NOTREACHED */ default: break; } diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index 9c37d8c97c3d..4decb24236bb 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -199,6 +199,7 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #define LINUX_SO_SNDBUFFORCE 32 #define LINUX_SO_RCVBUFFORCE 33 #define LINUX_SO_PROTOCOL 38 +#define LINUX_SO_DOMAIN 39 #define LINUX_SO_PEERGROUPS 59 /* Socket options */