aboutsummaryrefslogtreecommitdiff
path: root/slirp/misc.c
diff options
context:
space:
mode:
authorSebastian Ottlik <ottlik@fzi.de>2013-10-02 12:23:15 +0200
committerStefan Weil <sw@weilnetz.de>2013-10-02 19:20:31 +0200
commitaad1239a7e15f42c0b8a802433582c48417a4541 (patch)
treefee4e67adf710c1972d16546aecf9fe6b914dccd /slirp/misc.c
parentbcbe92fb080420551125994f3b15c139019da694 (diff)
downloadqemu-arm-aad1239a7e15f42c0b8a802433582c48417a4541.tar.gz
slirp: call socket_set_fast_reuse instead of setting SO_REUSEADDR
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> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'slirp/misc.c')
-rw-r--r--slirp/misc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index c0d489950a..6c1636f7b6 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);
opt = 1;
qemu_setsockopt(so->s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
qemu_set_nonblock(so->s);