diff options
author | Sebastian Ottlik <ottlik@fzi.de> | 2013-10-02 12:23:15 +0200 |
---|---|---|
committer | Stefan Weil <sw@weilnetz.de> | 2013-10-02 19:20:31 +0200 |
commit | 52e0850bfa0e713928e5eb7f8a785eb473837b49 (patch) | |
tree | 3518810addbcec657267b9757f2245bba3856797 /udp.c | |
parent | fe46980c85354e35ccd342b971855d5a028fe181 (diff) | |
download | slirp-52e0850bfa0e713928e5eb7f8a785eb473837b49.zip slirp-52e0850bfa0e713928e5eb7f8a785eb473837b49.tar.gz slirp-52e0850bfa0e713928e5eb7f8a785eb473837b49.tar.bz2 |
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 'udp.c')
-rw-r--r-- | udp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -344,7 +344,7 @@ struct socket *udp_listen(Slirp *slirp, uint32_t haddr, u_int hport, { 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) { @@ -362,7 +362,7 @@ struct socket *udp_listen(Slirp *slirp, uint32_t haddr, u_int hport, 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; |