summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-05-04 11:13:40 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-06-05 16:32:47 +0200
commit1b2cedebc035fad3ebe380c67e3d9a2c2c7e0742 (patch)
tree045d7e41c886bf4cdf2d4b19fdabf8ce8c0afb5d
parent62c2b5958d8695db1166d1af89a353482801d56f (diff)
downloadqemu-1b2cedebc035fad3ebe380c67e3d9a2c2c7e0742.tar.gz
gdbstub: set listen backlog to 1gdbstub-fixes
Avoid possible connection drops on Linux (when tcp_syncookies is disabled) or fallbacks to SYN cookies with the following kernel warning: TCP: request_sock_TCP: Possible SYN flooding on port 1234. Sending cookies. Check SNMP counters. Since Linux 4.4 (ef547f2ac16b "tcp: remove max_qlen_log"), a backlog of zero is really treated as the "queue length for completely established sockets waiting to be accepted" (listen(2)). This is apparently a valid interpretation of an "implementation-defined minimum value" for a backlog value of 0 (listen(3p)). Previous kernels would use 8 as minimum value, but that is no longer the case. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--gdbstub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdbstub.c b/gdbstub.c
index b126bf5b6d..f181dc3d80 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1630,7 +1630,7 @@ static int gdbserver_open(int port)
close(fd);
return -1;
}
- ret = listen(fd, 0);
+ ret = listen(fd, 1);
if (ret < 0) {
perror("listen");
close(fd);