From nobody Tue Aug 20 05:02:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wny4j6yj5z5VFxW; Tue, 20 Aug 2024 05:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wny4j53Jqz4Qjm; Tue, 20 Aug 2024 05:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724130133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BxyZ1Zmugg5CARhmjEgnOXD6HpvAzEfaP5FRY46Axk8=; b=O1h5BffrvbcyeUnJqOPtJ0wxxUtoCE1D8BIL091qVgYKcM9+jceSQqGOH6iD0tn56q+WAH ZLI6jcfTFz8zDqkjatKu+DEUI4/HJ5xdGwQjTX4Q1bx7kPZHDXOZ9VgeKl+gQvr5nLN6WO 8kmkyJee/wQUYas+JvAQc9WKNjSwihdbNZgz1BA+yez8NlGqN3ZFF7seT8QuedmlVCk9Id mhpkljC1gLBq7Rtc4Yh+fF89UO1Go7LuUjLM32rBYaq7Aif8W28LK++ftpd1uaind2602p PRBK2Xu1P2sR7qhmqWtVIJ7C+hHMy+lZbWDHIFupnn8ISsfMQ1VPKJkILLq9Fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724130133; a=rsa-sha256; cv=none; b=Pny2YKoiNCJKL73jZ2ph+l+0w108pd3+6bWeMObC3gjIKosW8MX8ORcIj1V7I0ELSoATi/ x+oYq/JlokExNgLwPTnHDAYO9tj4edoXDDP0o/VC3ILIo/nnL59jiwkA0OogFXGqzha8dI 9AakYRk0IfpKJV53VT5SpUQSWDPO/3lmVeew+oqLtg+X18pMO85uV6hNhzJn+CRl7BDoOd g/8Q9DwPSzE5ts4o0IHZsroPdTHHSb9oN9DJHXFyrOjA2qQKnITsQiqS0JWD66BpKoHdB6 C12tenTyOqvPPzBELHd2Iy0vOBS/aLbWv/DOWt+rIPJ4jEbVUl/Iz5p0pRRFKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724130133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BxyZ1Zmugg5CARhmjEgnOXD6HpvAzEfaP5FRY46Axk8=; b=A0ksGhknKoHk9fY2gaW9ckJininC7DtJoU6LGXkjFHFG1UaPCnTnumw1p0nFGZIHPkUKic AWqslHSvmTSnCXcO0G+Gz/H+9ovhQN+DNEMn3BftYcFuGlFlaxW3oyPPWNUNXs4gYY4H2E jP9nhiDQ4vpuR1IoYZIi0h3TU3Ssm8tF1nX5XBtUksyAAqVlL9XTQ9LfVCPPvPEl/hBog5 Zf+cDbGIyOQlXbXi7Ur9HsEfxkX7qo6zHJmv7bJEjTD6QjumE1/8lr3RODULXKAefn4/5n +xLBO0H+aEZzDv8tKNg+aS8aVemAQHNBgAwXxgr1HxfeFCUXGIi2ZMLkVAAbuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wny4j4TBVznGt; Tue, 20 Aug 2024 05:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K52Dpx072194; Tue, 20 Aug 2024 05:02:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K52Dcr072191; Tue, 20 Aug 2024 05:02:13 GMT (envelope-from git) Date: Tue, 20 Aug 2024 05:02:13 GMT Message-Id: <202408200502.47K52Dcr072191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 5f4e11e111a2 - stable/13 - dhclient: Make arp_timeout configurable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f4e11e111a26abe817e0f790cdbbd376374c45f Auto-Submitted: auto-generated The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=5f4e11e111a26abe817e0f790cdbbd376374c45f commit 5f4e11e111a26abe817e0f790cdbbd376374c45f Author: Isaac Cilia Attard AuthorDate: 2024-07-08 06:33:13 +0000 Commit: Colin Percival CommitDate: 2024-08-20 04:58:36 +0000 dhclient: Make arp_timeout configurable Make arp_timeout available to dhclient.c, set the default timeout to 250 ms, and provide a new command-line argument, 'n' for setting the timeout to 0. Sponsored by: Google LLC (GSoC 2024) Signed-off-by: Isaac Cilia Attard MFC after: 10 days Reviwed by: cperciva, brooks, Tom Hukins, Alexander Ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1368 (cherry picked from commit b51569ad3c806688befc00dad51d15a7e61659fb) --- sbin/dhclient/dhclient.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 27e027646ef6..576d7260086c 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -121,7 +121,7 @@ struct pidfh *pidfile; */ #define TIME_MAX ((((time_t) 1 << (sizeof(time_t) * CHAR_BIT - 2)) - 1) * 2 + 1) -static struct timespec arp_timeout = { .tv_sec = 2, .tv_nsec = 0 }; +static struct timespec arp_timeout = { .tv_sec = 0, .tv_nsec = 250 * 1000 * 1000 }; static const struct timespec zero_timespec = { .tv_sec = 0, .tv_nsec = 0 }; int log_priority; static int no_daemon; @@ -386,7 +386,7 @@ main(int argc, char *argv[]) cap_openlog(capsyslog, getprogname(), LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); cap_setlogmask(capsyslog, LOG_UPTO(LOG_DEBUG)); - while ((ch = getopt(argc, argv, "bc:dl:p:qu")) != -1) + while ((ch = getopt(argc, argv, "bc:dl:np:qu")) != -1) switch (ch) { case 'b': immediate_daemon = 1; @@ -400,6 +400,9 @@ main(int argc, char *argv[]) case 'l': path_dhclient_db = optarg; break; + case 'n': + arp_timeout = zero_timespec; + break; case 'p': path_dhclient_pidfile = optarg; break; @@ -576,7 +579,7 @@ void usage(void) { - fprintf(stderr, "usage: %s [-bdqu] ", getprogname()); + fprintf(stderr, "usage: %s [-bdnqu] ", getprogname()); fprintf(stderr, "[-c conffile] [-l leasefile] interface\n"); exit(1); }