aboutsummaryrefslogtreecommitdiff
path: root/slirp/udp.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/udp.c
parentbcbe92fb080420551125994f3b15c139019da694 (diff)
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/udp.c')
-rw-r--r--slirp/udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/slirp/udp.c b/slirp/udp.c
index b105f871f3..8cc6cb66da 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -354,7 +354,7 @@ udp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr,
{
struct sockaddr_in addr;
struct socket *so;
- socklen_t addrlen = sizeof(struct sockaddr_in), opt = 1;
+ socklen_t addrlen = sizeof(struct sockaddr_in);
so = socreate(slirp);
if (!so) {
@@ -372,7 +372,7 @@ udp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr,
udp_detach(so);
return NULL;
}
- qemu_setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int));
+ socket_set_fast_reuse(so->s);
getsockname(so->s,(struct sockaddr *)&addr,&addrlen);
so->so_fport = addr.sin_port;