From owner-svn-src-all@FreeBSD.ORG Sun May 3 16:36:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 716A2106564A; Sun, 3 May 2009 16:36:16 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 19C988FC1D; Sun, 3 May 2009 16:36:15 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 981089621F; Sun, 3 May 2009 20:36:13 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1770494657; Sun, 03 May 2009 20:36:13 +0400 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n43GaDGX030515; Sun, 3 May 2009 20:36:13 +0400 (MSD) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n43Ga89I030514; Sun, 3 May 2009 20:36:08 +0400 (MSD) (envelope-from dchagin) Date: Sun, 3 May 2009 20:36:07 +0400 From: Chagin Dmitry To: Robert Watson Message-ID: <20090503163607.GA30330@dchagin.static.corbina.ru> References: <200905021051.n42ApetI083033@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r191742 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2009 16:36:17 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 03, 2009 at 04:57:03AM +0100, Robert Watson wrote: >=20 > On Sat, 2 May 2009, Dmitry Chagin wrote: >=20 > > Linux socketpair() call expects explicit specified protocol for > > AF_LOCAL domain unlike FreeBSD which expects 0 in this case. > ... > > @@ -859,7 +859,10 @@ linux_socketpair(struct thread *td, stru > > return (EINVAL); > > > > bsd_args.type =3D args->type; > > - bsd_args.protocol =3D args->protocol; > > + if (bsd_args.domain =3D=3D AF_LOCAL && args->protocol =3D=3D PF_UNIX) > > + bsd_args.protocol =3D 0; > > + else > > + bsd_args.protocol =3D args->protocol; > > bsd_args.rsv =3D (int *)PTRIN(args->rsv); > > return (socketpair(td, &bsd_args)); > > } >=20 > I think I'd tweak this to be more like: >=20 > if (bsd_args.domain =3D=3D PF_LOCAL) { > if (bsd_args.protocol =3D=3D PF_UNIX) > bsd_args.protocl =3D 0; > else if (bsd_args.protocol !=3D 0) > return (EPROTONOSUPPORT); > } >=20 > Because (a) the domain argument takes a protocol family in FreeBSD and yo= u're=20 > passing arguments into the BSD ABI without a mapping for that field, and = (b)=20 domain argument is mapped, I used value AF_LOCAL which is similar to the value of localdomain .dom_family member. It misleads :) > for the protocol family the use of PF_UNIX is weird but must be supported= , so=20 > I'd consider it to be an entirely mapped namespace and avoid passing thro= ugh=20 > values that aren't 0 to the BSD layer as it's not clear what that would m= ean. >=20 agree. I send a new patch to the mentor. Thank you! --=20 Have fun! chd --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkn9x/cACgkQ0t2Tb3OO/O0d2ACgvGszDvbZhoVUCMQsTw+Umcdv 3l8AoL5kU8Njsjy3o+sDzXNrLO3YOHvh =Ty+m -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc--