From nobody Sat Aug 10 00:00:33 2024 X-Original-To: dev-commits-src-main@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 4WggsG3CjVz5SpWn; Sat, 10 Aug 2024 00:00:34 +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 4WggsG0tqtz54CK; Sat, 10 Aug 2024 00:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723248034; 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=HGCdcOJwv6Z+gouJKZvoiw33ap5d8+/Gl6v7k2GcZ8U=; b=lYvQZ7oh3/kPOiT094D+5C2cfGS9cmXo3E4B3V7NggmveL40akJxiO6WuHW8ZeWyV2BFTr c7Zo6iQLLAvdRSDD6768n2ciIV2RfcRRiWi52ce5g+jSwtdAHGJr2YLGcdxqO0okGheufC 2rQ7/sii/xEeFToIKUJuGT6cFAWNkxOYgG51YUeg/3oUFRLnLckkxGMQai8eaa4TxYQ7ZG +g8LF/hD4TwLEzCnFIjdwNq1yWllPQWsuuKcUlWm4dO44rCEVR44lSxmiizEnEdJIQatRq nys0zM1yeYlD9Cj5QHHIcxrPTeJpwiz2yEY8cVvhvfi1co/rqTZ8EIenY6M6hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723248034; a=rsa-sha256; cv=none; b=ss/8zXcvbyJ7iRBcXexV31TbWcGXPnRzWKbwnRt3Tb6Isga9/N3HmCa44C2UA1PrB+EMeT IUVRT+KX20tLu0HP1HtF67XceowYXjKxguNF+C1h0JZVZ3SeSBzGKyb9ro8kTl6FZQ2uOX I7mfl4sh44Rri9TPRf3Z7IlZjfrXbg6Dv2op6Q0+yoXBpYYQpqIaC0JK0K2AATXrhMwOX3 YSUiOXabO4cVHPCLNCPnQJRD/kjdEOpRpHCQTMPTxoXUY6qHpzAomfgteiiPuTYTkGWAOM 2E3omGlAVfJq3JrxiRK7Dt1SksB1XPg3ixjqWm/WwXqcxEcyWNNs/Phe5+r7/Q== 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=1723248034; 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=HGCdcOJwv6Z+gouJKZvoiw33ap5d8+/Gl6v7k2GcZ8U=; b=iyVQvuFRN3W3eWXTo2QiJQ8XqxUuSCla0GrZFrdu0EUVzwqq/dqKz1VHhbU0CLOKQxB4qz 0/9L4GNyReUWpUr/VG4Olw25S5PZDnPxR9SjPjcSp/We+uCTY2eWFxxswvDJGD+X2NgPBF LZCz2u1cnIfVgDyTK7EkXe8Hm72t7zT+2TrWHtDMDP1WolC2dNmL7X9aQ9jPyb3iRY4jlV 67Gg6+c3D0SPQfu1li/2jJp5+MaN82Zcbu7xhvIw1LKEmV7CYYghSCu2fBCHIMTPxP9DvJ R6wi7bmUvafxgcf0pAZ6+zZyuUWvFmNo7EWLT9EEypkX7S9FvVXMp2ioZB5bwg== 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 4WggsG0Vwjzd2G; Sat, 10 Aug 2024 00:00:34 +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 47A00XQY054539; Sat, 10 Aug 2024 00:00:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47A00Xnk054536; Sat, 10 Aug 2024 00:00:33 GMT (envelope-from git) Date: Sat, 10 Aug 2024 00:00:33 GMT Message-Id: <202408100000.47A00Xnk054536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: b51569ad3c80 - main - dhclient: Make arp_timeout configurable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b51569ad3c806688befc00dad51d15a7e61659fb Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b51569ad3c806688befc00dad51d15a7e61659fb commit b51569ad3c806688befc00dad51d15a7e61659fb Author: Isaac Cilia Attard AuthorDate: 2024-07-08 06:33:13 +0000 Commit: Colin Percival CommitDate: 2024-08-09 21:49:43 +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 --- 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); }