From aad1239a7e15f42c0b8a802433582c48417a4541 Mon Sep 17 00:00:00 2001 From: Sebastian Ottlik Date: Wed, 2 Oct 2013 12:23:15 +0200 Subject: 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 Reviewed-by: Eric Blake Signed-off-by: Stefan Weil --- slirp/socket.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'slirp/socket.c') diff --git a/slirp/socket.c b/slirp/socket.c index 25d60e7..37ac5cf 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -627,9 +627,7 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr, addr.sin_port = hport; if (((s = qemu_socket(AF_INET,SOCK_STREAM,0)) < 0) || -#ifndef _WIN32 - (qemu_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int)) < 0) || -#endif + (socket_set_fast_reuse(s) < 0) || (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) || (listen(s,1) < 0)) { int tmperrno = errno; /* Don't clobber the real reason we failed */ -- cgit v1.1