From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJQLA-0008F3-IH for qemu-devel@nongnu.org; Tue, 10 Sep 2013 11:59:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJQL4-0003oY-P5 for qemu-devel@nongnu.org; Tue, 10 Sep 2013 11:58:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJQL4-0003oR-G7 for qemu-devel@nongnu.org; Tue, 10 Sep 2013 11:58:50 -0400 Message-ID: <522F41B6.2000509@redhat.com> Date: Tue, 10 Sep 2013 09:58:46 -0600 From: Eric Blake MIME-Version: 1.0 References: <1378819619-20579-1-git-send-email-ottlik@fzi.de> <1378819619-20579-5-git-send-email-ottlik@fzi.de> In-Reply-To: <1378819619-20579-5-git-send-email-ottlik@fzi.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Omodeck3JPsDlbvwTSibi6iclBAlEe1lk" Subject: Re: [Qemu-devel] [PATCH v3 4/5] slirp: call socket_set_fast_reuse instead of setting SO_REUSEADDR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Ottlik Cc: Jan Kiszka , Anthony Liguori , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Omodeck3JPsDlbvwTSibi6iclBAlEe1lk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/10/2013 07:26 AM, Sebastian Ottlik wrote: > SO_REUSEADDR should be avoided on Windows but is desired on other opera= ting > systems. So instead of setting it we call socket_set_fast_reuse that wi= ll result > in the appropriate behaviour on all operating systems. >=20 > Signed-off-by: Sebastian Ottlik > --- > slirp/misc.c | 3 +-- > slirp/socket.c | 4 +--- > slirp/tcp_subr.c | 6 ++---- > slirp/udp.c | 4 ++-- > 4 files changed, 6 insertions(+), 11 deletions(-) >=20 > diff --git a/slirp/misc.c b/slirp/misc.c > index c0d4899..6c1636f 100644 > --- a/slirp/misc.c > +++ b/slirp/misc.c > @@ -212,8 +212,7 @@ fork_exec(struct socket *so, const char *ex, int do= _pty) > so->s =3D accept(s, (struct sockaddr *)&addr, &add= rlen); > } while (so->s < 0 && errno =3D=3D EINTR); > closesocket(s); > - opt =3D 1; > - qemu_setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, &opt,= sizeof(int)); > + socket_set_fast_reuse(so->s); Here's a case where the old code didn't care about failure, but the code in 1/5 results in a message via perror(). If that is intentional, it's best to mention it in the commit message. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Omodeck3JPsDlbvwTSibi6iclBAlEe1lk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSL0G2AAoJEKeha0olJ0Nq6TUH/3Hf9TlFwBBazo+cTFFu2ntD +6wkVC/S0kRYv/TMSqLQR6DKb4639hugTIaoEy159218pngRmH+dkzAVXUIqxXSQ kch7s6XBuBISjKy9/ef9id3c+kk+s/V2lBAarbqjq4K4cMp9YGrSLML0uMuzVllN pFU1mJjOSmND2kFGc+BmjMdPNHgViFzE+C3OQYxLNYPwF0nAeFXym7f3rvslhXLd uA2QhZbwOfLZETbR6m52sR43ZC4LGERk64FeC4RRkfgEGrhEAQBw+9OkZmryG9X/ muRwq1PruKTh9sT7EmlhvYr/fsDWUo25051GQJCZRjUoVP7E5OiG/vI2jSLQMMU= =rxir -----END PGP SIGNATURE----- --Omodeck3JPsDlbvwTSibi6iclBAlEe1lk--