From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WyPNc-0004pv-Nr for qemu-devel@nongnu.org; Sat, 21 Jun 2014 13:47:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WyPNY-0001WP-0I for qemu-devel@nongnu.org; Sat, 21 Jun 2014 13:47:08 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:62088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WyPNX-0001WH-PT for qemu-devel@nongnu.org; Sat, 21 Jun 2014 13:47:03 -0400 Received: by mail-wg0-f43.google.com with SMTP id b13so4882460wgh.26 for ; Sat, 21 Jun 2014 10:47:02 -0700 (PDT) Date: Sat, 21 Jun 2014 18:46:57 +0100 From: Paul Burton Message-ID: <20140621174657.GB3158@gmail.com> References: <1402849113-11402-1-git-send-email-paul@archlinuxmips.org> <1402849113-11402-5-git-send-email-paul@archlinuxmips.org> <20140621105933.GB23713@afflict.kos.to> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s2ZSL+KKDSLx8OML" Content-Disposition: inline In-Reply-To: <20140621105933.GB23713@afflict.kos.to> Subject: Re: [Qemu-devel] [PATCH 04/16] linux-user: support SO_PASSSEC setsockopt option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: qemu-devel@nongnu.org, Paul Burton --s2ZSL+KKDSLx8OML Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 21, 2014 at 01:59:33PM +0300, Riku Voipio wrote: > On Sun, Jun 15, 2014 at 05:18:21PM +0100, Paul Burton wrote: > > Translate the SO_PASSSEC option to setsockopt to the host value & > > perform the syscall as expected, allowing use of the option by target > > programs. >=20 > Another file that is a total mess in linux-user tree.. This should be > split out to arch specific header files - but that's for another patch. > For this patch - the value for sparc SO_PASSEC should be set, since > it's different from others: >=20 > http://lxr.free-electrons.com/source/arch/sparc/include/uapi/asm/socket.h= #L51 Good catch, and it looks like the same is true of some other already incorrect options for sparc (SO_PEERSEC, SO_BINDTODEVICE at least at a glance). Paul >=20 > > Signed-off-by: Paul Burton > > --- > > linux-user/socket.h | 2 ++ > > linux-user/syscall.c | 3 +++ > > 2 files changed, 5 insertions(+) > >=20 > > diff --git a/linux-user/socket.h b/linux-user/socket.h > > index ae17959..289c6ac 100644 > > --- a/linux-user/socket.h > > +++ b/linux-user/socket.h > > @@ -63,6 +63,7 @@ > > #define TARGET_SO_PEERSEC 30 > > #define TARGET_SO_SNDBUFFORCE 31 > > #define TARGET_SO_RCVBUFFORCE 33 > > + #define TARGET_SO_PASSSEC 34 > > =20 > > /** sock_type - Socket types > > * > > @@ -298,6 +299,7 @@ > > #define TARGET_SO_ACCEPTCONN 30 > > =20 > > #define TARGET_SO_PEERSEC 31 > > + #define TARGET_SO_PASSSEC 34 > > =20 > > #endif > > =20 > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > > index 679d165..b507f81 100644 > > --- a/linux-user/syscall.c > > +++ b/linux-user/syscall.c > > @@ -1529,6 +1529,9 @@ set_timeout: > > case TARGET_SO_PASSCRED: > > optname =3D SO_PASSCRED; > > break; > > + case TARGET_SO_PASSSEC: > > + optname =3D SO_PASSSEC; > > + break; > > case TARGET_SO_TIMESTAMP: > > optname =3D SO_TIMESTAMP; > > break; > > --=20 > > 2.0.0 > >=20 --s2ZSL+KKDSLx8OML Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJTpcURAAoJENzvn0paErs5bysP/2MaAS8PS+H45TaLfECXu5+q 2xkA/JkB5nBQUBWrEkevqr4n35nNsx8LPBKtBvjgbstbG3JeMurnDEUBH92GkLT2 78qEKo8EL5XEEEKuCz6Te1vSKqXA/bXIyHM0bFtgwaulgTHQ9ejGN78VZqBoGi5r Rjvp9sk+QS/4hDOHxU21vXzlufIAncPXupOCuBwvIMkXDnKnF7hejV49QFYWJUVN 0F1MzInYI9GnMUXnC8VRr2qiy0zLgFNrsVHZIyz8WvA6l0JqYwF/Vrg49lYtvvTt qW12Ln2/m8TxNjGSBRAm4cWDqR9EZO43D/UWroBH3XxEKUg7BcGGTM72l/73xtZw I9ikvXz+7bLyYkuofENV6mzgbbjwTxficPY9bKKIJbBMW4KZMP+2M/G0wFYBYTPs fsyO7n0ZtAmvxqkL+RZtzhNKws8vsFJA6s3fiTI2ntTZWLusoqn+TTNqUk0mOEvi kET1jW5Gn1LvQFshM6l73d+5lSVqNm3LOgg5Sb1NhWW+1YKzqsrqSdprDB1v/l8w /QUmUIfm/79ClmvtKtBY1PmwRjEnHFuGUDuS8dk03z9Ag7TnKHpo+ENHbEBM9Ndb Niy0EqHR1WT8xmY0+wcb2d5EycCIp5yxmnyJr+3hj4M7n4kMRVP9fz+QSZjKCCp5 EF/o0/tlmmPoQsl50tg/ =AoyZ -----END PGP SIGNATURE----- --s2ZSL+KKDSLx8OML--