From nobody Mon Apr 11 20:32:51 2022 X-Original-To: dev-commits-src-main@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 A74C011DFABE; Mon, 11 Apr 2022 20:32:51 +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 4KcgXM4Hzpz3QPr; Mon, 11 Apr 2022 20:32:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649709171; 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=j2faxGWMtCbZzawdj9pmEooNdOlcr1h5vku4ziEvL94=; b=UvPjXDNnmG/GHPRlNy/glct0WTa3+xLTFhDyEkkjDOqgUpmRpi2myKHEhiG2SrGYT2RafT mIPWkWrKptX3jiMA0MmaiI81GPVK0AbMU1A1MruddkKjeE+syAieJQJtniDP7hNZdCNB/B hmAGO2elbtDeYmCinFTdx2FbV5KllgNdlW6fdu9MJSi492se7TzZvZp7Ef6u9aEDtBFBW6 12AyLPvtBxMB2l5VXWEcFm6RtE+wL8fXiBFCLRUum6xz6sM3Z4dh7ApMe1HcEt/DB1bcuL kX9TsJtliireYUlCzANcIjZ8gwEsvFBtDFx7lHq1pWge9RD5PVP50GTtdh5HBQ== 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 74C981B44; Mon, 11 Apr 2022 20:32:51 +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 23BKWpG5082825; Mon, 11 Apr 2022 20:32:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23BKWpmm082824; Mon, 11 Apr 2022 20:32:51 GMT (envelope-from git) Date: Mon, 11 Apr 2022 20:32:51 GMT Message-Id: <202204112032.23BKWpmm082824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: cf312f799a86 - main - linux(4): Handle SO_DOMAIN in getsockopt syscall. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: cf312f799a867b4b1beef0536a162062659659a6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649709171; 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=j2faxGWMtCbZzawdj9pmEooNdOlcr1h5vku4ziEvL94=; b=UQt1Elm/rgf+Rl+8Eu1C0Go+30otTFonXclqUHpMc3zDX08Yh5d5cUy1hh6q6VRlWh7QJF 5eauRsCn8L7aV/UduPnuHLhnyeUwRVRcmmLY0zm+x/8u7PvAsqTXllAd6E9mrJOaZTXird 2E4aEh1AqG79Q5NO+iZuieSy+/L4uxNzsx2OI3vEMPkauqIJhq3/HneD6Vw5+gPVNzidtU 3AI2Q595tDp8JV/DuhRtd/pHdzUR2YGtIeWK26QfSM4P8IASfn102N4u8tQXbNF8o3ZqIV o7D+rDDF6Ljt3DStBS+W+ezBi7v5LSgENMxJedXIPHG63VewUcul4z3kuPUaog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649709171; a=rsa-sha256; cv=none; b=ffGH5FcYbJRKpyuEUWv0GN2oaqYfT7rpnTX4pBhLZ6l4OyVrmqRN5YiFI46mrwmJzrXgLK GI86Xiwpwa49i4bGJdBEdjsuNfaes3vTo+/HdIkGfEgUrHi1bCZ54xBNOAhiUwJPqN3z1j Ava3FLkxP3eSZEw44oX/V3Z1eoKMK5Spbd8QU4F2OwzWlSrTReaAP6EZqLow1tepPx8u1a uXIp03WXRLiUk8kzUz/eD5bmlRFuutd0/3mJ69pNDyzssrkTZ2KdHQHL/ZN7PPshiEWaQI 41hAdT2nY2xC+uNjPcj49/N4+3ugPP2D2N7Jh/kkzpK1NAKT0Me0b7Le1EmDIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cf312f799a867b4b1beef0536a162062659659a6 commit cf312f799a867b4b1beef0536a162062659659a6 Author: Dmitry Chagin AuthorDate: 2022-04-11 20:31:28 +0000 Commit: Dmitry Chagin CommitDate: 2022-04-11 20:31:28 +0000 linux(4): Handle SO_DOMAIN in getsockopt syscall. Differential revision: https://reviews.freebsd.org/D34714 --- 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 */