diff options
author | Sebastian Ottlik <ottlik@fzi.de> | 2013-10-02 12:23:13 +0200 |
---|---|---|
committer | Stefan Weil <sw@weilnetz.de> | 2013-10-02 19:20:31 +0200 |
commit | 6669ca13c39a8515cc634695698d3dea5f39be1c (patch) | |
tree | 75c0bca63a7d32bee3cc051a2e11f388f573dd97 | |
parent | 606600a176c981addcfedb0698f13fd0f2f4446e (diff) | |
download | qemu-6669ca13c39a8515cc634695698d3dea5f39be1c.tar.gz qemu-6669ca13c39a8515cc634695698d3dea5f39be1c.tar.bz2 qemu-6669ca13c39a8515cc634695698d3dea5f39be1c.zip |
gdbstub: 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>
-rw-r--r-- | gdbstub.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1553,7 +1553,7 @@ static void gdb_accept(void) static int gdbserver_open(int port) { struct sockaddr_in sockaddr; - int fd, val, ret; + int fd, ret; fd = socket(PF_INET, SOCK_STREAM, 0); if (fd < 0) { @@ -1564,9 +1564,7 @@ static int gdbserver_open(int port) fcntl(fd, F_SETFD, FD_CLOEXEC); #endif - /* allow fast reuse */ - val = 1; - qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); + socket_set_fast_reuse(fd); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(port); |