qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Sebastian Ottlik <ottlik@fzi.de>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/5] slirp: call socket_set_fast_reuse instead of setting SO_REUSEADDR
Date: Tue, 10 Sep 2013 09:58:46 -0600	[thread overview]
Message-ID: <522F41B6.2000509@redhat.com> (raw)
In-Reply-To: <1378819619-20579-5-git-send-email-ottlik@fzi.de>

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

On 09/10/2013 07:26 AM, Sebastian Ottlik wrote:
> SO_REUSEADDR should be avoided on Windows but is desired on other operating
> systems. So instead of setting it we call socket_set_fast_reuse that will result
> in the appropriate behaviour on all operating systems.
> 
> Signed-off-by: Sebastian Ottlik <ottlik@fzi.de>
> ---
>  slirp/misc.c     |    3 +--
>  slirp/socket.c   |    4 +---
>  slirp/tcp_subr.c |    6 ++----
>  slirp/udp.c      |    4 ++--
>  4 files changed, 6 insertions(+), 11 deletions(-)
> 
> 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 = accept(s, (struct sockaddr *)&addr, &addrlen);
>                  } while (so->s < 0 && errno == EINTR);
>                  closesocket(s);
> -                opt = 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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-09-10 15:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 13:26 [Qemu-devel] [PATCH v3 0/5] Do not set SO_REUSEADDR on Windows Sebastian Ottlik
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR Sebastian Ottlik
2013-09-10 15:56   ` Eric Blake
2013-09-10 16:23     ` Sebastian Ottlik
2013-09-10 16:34       ` Eric Blake
2013-09-10 16:39         ` Sebastian Ottlik
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 2/5] gdbstub: call socket_set_fast_reuse instead of " Sebastian Ottlik
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 3/5] net: " Sebastian Ottlik
2013-09-10 15:53   ` Eric Blake
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 4/5] slirp: " Sebastian Ottlik
2013-09-10 15:58   ` Eric Blake [this message]
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 5/5] util: " Sebastian Ottlik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522F41B6.2000509@redhat.com \
    --to=eblake@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=ottlik@fzi.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).