From patchwork Wed May 4 09:32:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Wu X-Patchwork-Id: 9011781 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D888CBF29F for ; Wed, 4 May 2016 09:34:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 139D820392 for ; Wed, 4 May 2016 09:34:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B26F420384 for ; Wed, 4 May 2016 09:34:06 +0000 (UTC) Received: from localhost ([::1]:46550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axtBy-0004zv-RS for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 May 2016 05:34:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axtBk-0004g1-E1 for qemu-devel@nongnu.org; Wed, 04 May 2016 05:33:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axtBY-0003gg-Iw for qemu-devel@nongnu.org; Wed, 04 May 2016 05:33:42 -0400 Received: from mail.lekensteyn.nl ([2a02:2308::360:1:25]:56082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axtBX-0003bW-6m; Wed, 04 May 2016 05:33:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lekensteyn.nl; s=s2048-2015-q1; h=Message-Id:Date:Subject:Cc:To:From; bh=e+oVS3DZqQ1lPS0FzVAgMXBfLfNDb0xxvSA9WnhKTkg=; b=h12MQnq3ahlWlys5HKIa4VeSZ293CY7y6j0oGQXVsKEIhtTdd7DizM07a3oFELBvh21U6W5nY5Lw6YnlAHOObgDxpk9b2jAywdomaO1LVrhfe2L/s7hsyIJ9nwO3rAzjPp8R1/HGpdFg2ZoOdsKTo4yK99Hzu7mYzCkiS22sAiZ4d76e8MZMoAeyLm2q8WISeZ9ChVowTNErhZoMG/07oo+yzIgPI2wsFLzVXajQF6D5tAJ/B783e2HAb/T2kGlSlVaB+fN6W1f60Q/ZVkD5dIp9Sp22YmZ9qbvxkNhBqMNtD3uryBn+7S4B36tvhqBwUppSjTGE+CXlg3zRVv9uWQ==; Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1axtB2-0002Mq-4M; Wed, 04 May 2016 11:33:15 +0200 From: Peter Wu To: qemu-devel@nongnu.org Date: Wed, 4 May 2016 11:32:17 +0200 Message-Id: <1462354337-1733-1-git-send-email-peter@lekensteyn.nl> X-Mailer: git-send-email 2.8.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:2308::360:1:25 Subject: [Qemu-devel] [PATCH] gdbstub: set listen backlog to 1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Hi, This was also reported at Linux, but the author of that patch argued that it is intended behavior[1]. Kind regards, Peter [1]: https://lkml.kernel.org/r/1462321544.5535.337.camel@edumazet-glaptop3.roam.corp.google.com --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index b126bf5..f181dc3 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);