[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 2/5] gdbstub: call socket_set_fast_reuse instead
From: |
Sebastian Ottlik |
Subject: |
[Qemu-devel] [PATCH v6 2/5] gdbstub: call socket_set_fast_reuse instead of setting SO_REUSEADDR |
Date: |
Wed, 2 Oct 2013 12:23:13 +0200 |
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 <address@hidden>
---
gdbstub.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 2b7f22b..0e5a3f5 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -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);
--
1.7.9.5
- [Qemu-devel] [PATCH v6 0/5] Do not set SO_REUSEADDR on Windows, Sebastian Ottlik, 2013/10/02
- [Qemu-devel] [PATCH v6 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR, Sebastian Ottlik, 2013/10/02
- [Qemu-devel] [PATCH v6 5/5] util: call socket_set_fast_reuse instead of setting SO_REUSEADDR, Sebastian Ottlik, 2013/10/02
- [Qemu-devel] [PATCH v6 4/5] slirp: call socket_set_fast_reuse instead of setting SO_REUSEADDR, Sebastian Ottlik, 2013/10/02
- [Qemu-devel] [PATCH v6 2/5] gdbstub: call socket_set_fast_reuse instead of setting SO_REUSEADDR,
Sebastian Ottlik <=
- [Qemu-devel] [PATCH v6 3/5] net: call socket_set_fast_reuse instead of setting SO_REUSEADDR, Sebastian Ottlik, 2013/10/02
- Re: [Qemu-devel] [PATCH v6 0/5] Do not set SO_REUSEADDR on Windows, Eric Blake, 2013/10/02