From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLZPj-0003wQ-MU for qemu-devel@nongnu.org; Mon, 16 Sep 2013 10:04:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLZPe-000875-QN for qemu-devel@nongnu.org; Mon, 16 Sep 2013 10:04:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLZPe-00086x-HN for qemu-devel@nongnu.org; Mon, 16 Sep 2013 10:04:26 -0400 Message-ID: <52370FE6.209@redhat.com> Date: Mon, 16 Sep 2013 08:04:22 -0600 From: Eric Blake MIME-Version: 1.0 References: <1379319907-14950-1-git-send-email-ottlik@fzi.de> <1379319907-14950-4-git-send-email-ottlik@fzi.de> In-Reply-To: <1379319907-14950-4-git-send-email-ottlik@fzi.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="P1EvuIxpk3UFI0qtwAC0iXKeIvXqL1UEO" Subject: Re: [Qemu-devel] [PATCH v4 3/5] net: 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) --P1EvuIxpk3UFI0qtwAC0iXKeIvXqL1UEO Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/16/2013 02:25 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 > An exception to this rule are multicast sockets where it is sensible to= have > multiple sockets listen on the same ip and port and we should set SO_RE= USEADDR > on windows. >=20 > /* allow fast reuse */ > - val =3D 1; > - qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); > + socket_set_fast_reuse(fd, false); Changed from silent to noisy. Intentional? > @@ -661,11 +665,9 @@ static int net_socket_udp_init(NetClientState *pee= r, > perror("socket(PF_INET, SOCK_DGRAM)"); > return -1; > } > - val =3D 1; > - ret =3D qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, > - &val, sizeof(val)); > + > + ret =3D socket_set_fast_reuse(fd, true); > if (ret < 0) { > - perror("setsockopt(SOL_SOCKET, SO_REUSEADDR)"); > closesocket(fd); > return -1; Changed from noisy to silent. Intentional? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --P1EvuIxpk3UFI0qtwAC0iXKeIvXqL1UEO 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/ iQEcBAEBCAAGBQJSNw/mAAoJEKeha0olJ0Nq2gsH/R+4bfCN/ikVtP9xUHbpVyoE 2agnZ9mygzO+zkdaOcnCxoLEDyPWXfUfR8HWcvgQU6sNxo4pYb8m6vwKqeW4fMcv 0ZvAnGmhTEM2pG4VPb+xxMEmYtAW81xgMspZ2TAWZ3tCJAMX0U4w7uPvHI+3CZ6d dZtZ9eGb0tWDFEtJx6KAioZlX1r2HP01FTB2AUl3Kj6WIGjpXfycpf8waEKxV34K AW2nGyeigFZD7Nr4agMsYQu49nM6Tp4jtcLky4pykk3vg3APFvJ/gSTUrFPhl0mR H1zl1DyHoQIyWhe/ptk6wOCqDOS4tRNQZr8Q/9AQA30chMiK7snvhN+GYOAQOD0= =27Gl -----END PGP SIGNATURE----- --P1EvuIxpk3UFI0qtwAC0iXKeIvXqL1UEO--