From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 Received: by atuin.qyliss.net (Postfix, from userid 496) id DEFA7A99D; Sat, 20 Mar 2021 20:55:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id A14F7A962; Sat, 20 Mar 2021 20:55:41 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id A431BA95D; Sat, 20 Mar 2021 20:55:39 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by atuin.qyliss.net (Postfix) with ESMTPS id 51319A8CD for ; Sat, 20 Mar 2021 20:55:35 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id AA1E55C0098; Sat, 20 Mar 2021 16:55:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 20 Mar 2021 16:55:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=cJAZrEekyoCCqqU8XJVmPNgZKxP zeeEuFChr5uTQdvY=; b=ZUh1VBbZLiieqNEKyxKThDLg4kpTqSK/sU7ys17KzQ9 I2IMfKzzffHlkBf2P1p0T3ZBWpRIJUvhBQraMBE8Amw8YT503Jyl7vkfcuLwdtqN bqK6cTAYwnnTn9RKGt37MZ7Kqmy6X9TrjfO6ebESQjFhquwZkilh7Pln4JatRYJh ib2egdL+s2SzkSSxpYRBaAzZE+AAiix7ZKIxaz6b/xKLhEFCCyUNZ8TG/P6/vzJT yfAeNZxStafSN+VqqB0c6/rPdpwaUeqgZtgQDfUyhzEFytt34QYn4lzM+v6j74d6 6W6WI+fM29fafcwR0EMtYA0jKRLBPB9BP+Fhje0RZAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=cJAZrE ekyoCCqqU8XJVmPNgZKxPzeeEuFChr5uTQdvY=; b=J5like3iky1m1HhIKPusBC dxx1NjbZWFEOJjyLOjqpdtDxRfnCbeHKSkyI3sod7EGZk4aO6Wl0oaBD7MXMB84k NnwYc7iV+kKGBzLFeHzw7zFx9W0W35cAiMrEhB694wLmwm4am0lfmvzM9PVLqCje OvBK9cwv8UokhNVWqlcxEMXMZ+mfBa1eg3oqHy8IyPR6XHc6FU6p3q4NixSbNRzY 0yIvo2BzB2bfuH6RyaG9eKZTOQbKepPHlvzWiikicBevw71NcZ4mLNWZoZ7zV6Vq 6SidItf8tb+TrZxwsgFWvE/S3M+Fepgsty3bAV+uabLBOW25LUI2CCumzCINQ5MA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegtddgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdttdertddtvdenucfhrhhomheptehlhihs shgrucftohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhephe evudfhgeefheekheffvdehuddttddvkefgtdegiefgudelhfekuedvgfekvefhnecuffho mhgrihhnpehuthhorhhonhhtohdrtggrpdhvshhotghkshgvrhhvvghrqdhsohgtkhgvth gsihhnuggvrhdrtgifnecukfhppeejledrvdefuddrvdehgedrjeelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepqhihlhhishhssegvvhgvrd hqhihlihhsshdrnhgvth X-ME-Proxy: Received: from eve.qyliss.net (p4fe7fe4f.dip0.t-ipconnect.de [79.231.254.79]) by mail.messagingengine.com (Postfix) with ESMTPA id 47D2C240311; Sat, 20 Mar 2021 16:55:33 -0400 (EDT) Received: by eve.qyliss.net (Postfix, from userid 1000) id 94C58FCD; Sat, 20 Mar 2021 20:24:41 +0000 (UTC) Date: Sat, 20 Mar 2021 20:24:41 +0000 From: Alyssa Ross To: Cole Helbling Subject: Re: [PATCH ucspi-vsock 7/7] Extract vsockserver-socketbinder and vsockserverd Message-ID: <20210320202441.m4leazkzrgduofwz@eve.qyliss.net> References: <20210319031713.23600-1-hi@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5rfrbbalgy6hw7sy" Content-Disposition: inline In-Reply-To: Message-ID-Hash: OIUCC4U6LG6QZAGB6FUZ357XAV6G6CJL X-Message-ID-Hash: OIUCC4U6LG6QZAGB6FUZ357XAV6G6CJL X-MailFrom: qyliss@eve.qyliss.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: devel@spectrum-os.org X-Mailman-Version: 3.3.1 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: --5rfrbbalgy6hw7sy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 18, 2021 at 08:39:31PM -0700, Cole Helbling wrote: > > + if (listen(fd ,40) == -1) > > Minor formatting nit (comma, then space); but also, what is `40` > representative of? Should this be `#define`d, or otherwise assigned to > some descriptive name? Looks like the next thing I should do after this is set up clang-tidy or something. ;) It's the backlog parameter, i.e. the minimum[1] number of connections the kernel should allow to queue up before it starts rejecting them. Would the following additional diff make you happy? :) (I won't bother resending the whole patch with it applied; for the purposes of reviewing just pretend this is part of the patch I sent.) [1]: https://utcc.utoronto.ca/~cks/space/blog/unix/ListenBacklogMeaning PS: cool thing I just discovered -- you can pipe this message to git apply, and it'll find and apply the diff (without trying to make a commit like git am would). diff --git i/vsockserver-socketbinder.c w/vsockserver-socketbinder.c index 598c01c..fdcdfa8 100644 --- i/vsockserver-socketbinder.c +++ w/vsockserver-socketbinder.c @@ -20,6 +20,8 @@ #include "num.h" #include "vsock.h" +static const int LISTEN_BACKLOG = 40; + noreturn static void ex_usage(void) { if (verbosity) @@ -71,7 +73,7 @@ int main(int argc, char *argv[]) diee(EX_OSERR, "fcntl"); if (vsock_bind(fd, cid, port) == -1) diee(EX_OSERR, "bind"); - if (listen(fd ,40) == -1) + if (listen(fd, LISTEN_BACKLOG) == -1) diee(EX_OSERR, "listen"); // Place the socket at stdout. --5rfrbbalgy6hw7sy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmBWWggACgkQ+dvtSFmy ccACJw/6AudWwPN7GqmMjlCrJfk5joQeol5d3mH4mQvTW0a+GNL0jic76X12ikxb Yqdu3SdUipGe58CA/s8vLeU693ZKORRlg6NW/aeULAg/3aOtWmisGPgkJaKmfeJ+ tJWc4S5LoxgCz9/iS/egRZ5fHEMYVUHiBo9aygjLkzKU5JnO0mNjz5pFTsulZ+I+ O2dGLE8Flgm9HA+JOZuRj4TDQHednroeQd0pSegmoi/iXJ6w3enzh/4K0VVkbQcC PcxIVIicVu7jNvpEL2p5pA3yDe3iz1tJAXpabheH4b9pUIyBaCMDAQ+E0Jcs3uY5 u1X8NMwRLywTYrgx+lHFMiUHUs08FejDkl/eOfDRWHDc/ldu55gkSIeLTmRsUWm4 sozaDIpgMvrmVMnSihC7GJDXa4xCYUqEPEoGuZb4oiD1X4rJHah4eIdc6CA3NELg qc4pr1EUCXo98it0sFxBgCpVeZ8ce0MjJyC/Lc0g+lXUreycNOG1e7Jec4kOV6F6 qxXf1zdACfCYZA9Tq/Ee/lIfnqJ7IPAL5+v/60clIurG0V+tvJPceLFWz/2hQsVU PHP0h87uofvpbVj0sjJ2z+UIisFel0uThWTPse1yInXqYfcIhP9fF4k7z1Fbdd7I Amkc6Sqj8xDdAhQ/9FC3dkfGzT9M5iYEH0XQ1x6pIyMoGtHt65Y= =7ys7 -----END PGP SIGNATURE----- --5rfrbbalgy6hw7sy--