From nobody Tue Aug 20 04:58:18 2024 X-Original-To: dev-commits-src-branches@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 4Wny0B6nn3z5VFjX; Tue, 20 Aug 2024 04:58:18 +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 4Wny0B5Njvz4Nh7; Tue, 20 Aug 2024 04:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724129898; 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=l5qjD9IMKWl2OtJaKwazcoVv1LSBRTkDZtqO5C9mcw0=; b=Eq98KrKIfB08n0z+/3kgcrZRi0o9Bu+OmQiYqa3EY0M+MLq1C131b1Noj/UPbbw/idpXDn 7K68E/UFy4mqHjFtUbNobCJ/Mfe+T/PuqxQNKy7pR57cFbWC52cPhzsuLUBLKxUNY3KC/Z DZjBFX4PRrgVmyVsCD0WGawRl4u5Sgb4HHb0cr/axsmXaUFjLf6A1gRkNVXOZVNKZkJld6 EgBWeWXbSGi4ezbg846AO1zvSVjPpoadcPb3vB2fK8KwkurvTj1S0lYpRjZVBNsoalE110 dIwSaLVIs/Ec0ZBjrTCyOJq6JMUUEe2TRy4z805QGnlaIFQn6lqYZhV7rBM07w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724129898; a=rsa-sha256; cv=none; b=Ryieqa5qn0EwSxyR2CAkFLRvvFhivg8rYWzHMSywNsq+1immfSHie5mraXUECkIcB4EH8b ZjisDYT0VJrT4Jjx5wEg7IoHboS9UO7viShNECBFco1cCGF686xMvd7VL5r+GtOB3S86V+ kurMydHwdYRag/3oLDklFdoilKIwc8tQybUrhutWB0YHRmL8PY0guWINmFsvQDIiGWEyVA dmsor9L1xHXHOfeL11PCf33QOEco42dBUwr+RKdfppuzUboHC0dplz62umhghxGL1dd9rO bau5qypSucCarXRHjjR7ssN+H0iXN9jIIdZRzlKNbO7TS342dSywJTwnyhoNdw== 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=1724129898; 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=l5qjD9IMKWl2OtJaKwazcoVv1LSBRTkDZtqO5C9mcw0=; b=UIJqWJDxIPpyJg4xFc2QZsknb4S4Do/0XIgtaLeiP4zZKTdiHNK+E2A684rq3/adv7vE1e RZXyqH4J72okixl8K1uf5b2gR8GOFeM0NuCdSdhvI2N+dYnsFSktV3Z/iYR5oqDrJJV+Li f1CncbR9zya0n/zbMsfOkf8js04gNwVZoG4P3oGKC7n6hatKcSmXwAlWXDUGqOGbatYKjR W1SuMGhmdk7aX21I8gKL993yLQ0mfNVaNqbT0z6ngALHFJloTFje2kDHC/s+nITf+Tt3Pm 2mU/8LtNwKhXsDaTZPTBn4psBm+cuwVJeb2hqYYFGG4tHGTR6Rk5VeRjmxvEXQ== 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 4Wny0B4pzXzmKj; Tue, 20 Aug 2024 04:58:18 +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 47K4wIWp054255; Tue, 20 Aug 2024 04:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K4wIDN054252; Tue, 20 Aug 2024 04:58:18 GMT (envelope-from git) Date: Tue, 20 Aug 2024 04:58:18 GMT Message-Id: <202408200458.47K4wIDN054252@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: 7bdd17d8d30a - stable/14 - dhclient: Make arp_timeout configurable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 7bdd17d8d30a2c29dd5d8ea733435917be39eefe Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7bdd17d8d30a2c29dd5d8ea733435917be39eefe commit 7bdd17d8d30a2c29dd5d8ea733435917be39eefe Author: Isaac Cilia Attard AuthorDate: 2024-07-08 06:33:13 +0000 Commit: Colin Percival CommitDate: 2024-08-20 04:57:08 +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 043f7808bb9d..4a674cec5888 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); }