From nobody Sun Apr 13 02:11:10 2025 X-Original-To: bugs@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 4ZZv6T3WZxz5t63Q for ; Sun, 13 Apr 2025 02:11:13 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZZv6S014mz3Jgk for ; Sun, 13 Apr 2025 02:11:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744510272; 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: in-reply-to:in-reply-to:references:references; bh=IMzGtGQvbWprlchobLxIxkgznfT7aDw5UJjVIXxhtEg=; b=JBdb3+U6HAyz9HNriBM6M0rS1Qp+rSLOf9GrTifI4CErlpyr9BRQb5yPqJh3O+eSDe81dS ops5lL3FVuOZfMmkS3i0IBLCy11vvXRVgMd2Ty4AkfyDQkSjtDD+l6+Fj7owSuA5224RWg NUekx46dmywllmBnBj0zpjy3Smi3uBl3+bD1q/Pbgy5FAe+SRAEk5GTFGHriOC0toaRRV9 GqubSHqLGJatqM+icJAahRf7UmyIGvqwIOccRp6XYFIZdTrrhzm8BdugJemrIeZO6kSx8i DVPmE0bNRReSibohypnZN9i0JI6wNQGICQ9HZiKFG0s9pcceczkAPcran9Eg+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744510272; a=rsa-sha256; cv=none; b=W2VMv7Ve93imZMHv/q+1rNEzRx72dq27ZXAXPGVxF9qX7OjH32a+xFJY6Jz/cvZxeMDijq mvGBSWvb+3cYnrZjWitSp3/qr5e+iU6Lq8eR/wSSIgcR0rJqC+gTdK0dYtCVAwiSEnvWbl THZTLmWVjHBdIDP6iGoHecbC5yOgRDoHAxGQFvDgAL221XWlDEQZsbMicpOEWNRHJQbHa3 OImSWAMh2CTO8l7FDm5vF9zqlItwufk83yqMBNZsbjZAqWWKPmlwOHr98Ft3IZ0hYvkygT szXgvGOiUBrZKnGnAdi3Vbd13gUXFCxBFsABQdEAmiTXqbdQEnpcE/jGll/9OA== 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=1744510272; 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: in-reply-to:in-reply-to:references:references; bh=IMzGtGQvbWprlchobLxIxkgznfT7aDw5UJjVIXxhtEg=; b=miy0yt1dSoSuHa/6dV0TP9Q0WJ6cK1seMlmPnDkVTiLE6GsmSilmS8cGo/wNnuYyeOX3jA jU2B9nNtatZPK15e/JCcV+gl0gK9Bu8KX5lkTE9m21uS9+oD1PEYTxDAf1rs33J90CSt94 d7irsANXXyW74A+MSjjKJOswSOVGRkXJ1pWd20WCtT/N/x2Xo4uCjHhGT3ZgX5Za34F+Bm ujfe9W3zePKj1rNjDEwQ1drq9AYU9/1863Z+mA6DgyTQUXaf/5rg9Bk/PQfCvd+hxks+oO lPXMMoq/arKCxElYUf426b7AseRoamEbMjFV+v+n3Rd2ThO/EkNbDwM+izaNsA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4ZZv6R61Wlzkds for ; Sun, 13 Apr 2025 02:11:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 53D2BBfS045214 for ; Sun, 13 Apr 2025 02:11:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 53D2BBVl045212 for bugs@FreeBSD.org; Sun, 13 Apr 2025 02:11:11 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 283256] CLOCK_MONOTONIC in dhclient Date: Sun, 13 Apr 2025 02:11:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283256 --- Comment #4 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D43d19e6a4c42ade0f276ceca18a09e2e3= 829fce4 commit 43d19e6a4c42ade0f276ceca18a09e2e3829fce4 Author: Colin Percival AuthorDate: 2025-04-08 22:50:01 +0000 Commit: Colin Percival CommitDate: 2025-04-13 02:09:56 +0000 dhclient: Keep two clocks Until July 2024, dhclient kept track of time as seconds-since-epoch as a time_t. This was a problem because (a) we wanted sub-second timeouts and (b) timeouts didn't always do the right thing if the system clock changed. Switching to using CLOCK_MONOTONIC and struct timespec fixed those issues but introduced a new problem: CLOCK_MONOTONIC values were being intepreted as seconds-since-epoch and written to the dhclient.leases file, causing confusion with DHCP leases expiring in early 1970. Attempt to compromise between these by keeping track of both times; any type within dhclient which is a time_t now refers to seconds past the epoch, while any struct timespec value is a CLOCK_MONOTONIC time. PR: 283256 Reviewed by: dch Fixes: f0a38976b01e ("dhclient: Use clock_gettime() instead of time()") Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D49720 sbin/dhclient/dhclient.c | 50 +++++++++++++++++++++-----------------------= ---- sbin/dhclient/dhcpd.h | 4 ++-- sbin/dhclient/dispatch.c | 14 +++++++++----- 3 files changed, 33 insertions(+), 35 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=