From nobody Tue Jun 25 15:55:01 2024 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 4W7qCn57BHz5PXhK for ; Tue, 25 Jun 2024 15:55:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W7qCn2DcMz3xnP for ; Tue, 25 Jun 2024 15:55:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719330901; a=rsa-sha256; cv=none; b=i2bX8+cb5NeRZglImkW/c9bMQnJoVonpZLp/Lbd/CyJBLMVqihpkfAwrtDZV6/h2l8oCfH yFkLqEQrMjy7soxf5GonsXBvzgKJlgfDnWeuANOiEmNw7hnKXv/PuUzi9lkUPukzD+jDhx iFk3/KTQzHGzKtVhhlfVsPQKy87/JKpZAFvjtEWQOeqDYiZIhm7yxzrKYEYjoyLpSeN8jM g3dlvzcu7DmDDrYkStILUd+tojlvJwrI2vYKohpNo6+zBu7gcUoR0qUfjlKPcpwy9m9V6T V7I8zIMuX6Ly7ZrExmrhO1U3MexYSt2j4eQTj0Y95YtkEuV1DUEAexCX6W+jyA== 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=1719330901; 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=fbdRa0G3CSlHNYB2tE4zLD45JpcxOlUVZwGFrxCddKA=; b=up8FsequrOgiPaqFUpg6dH6oATkNrj3mKmVfpyoAvQkNFW/ckX9PDxCntgCDt+4K7EMBXe OrXUhmtCyoFlMTNdtdnMFK3jjZbx7Bal1YNVeD/dnxKsdjvJ6GNQ55lcPLBq6dEV/p7fy3 0HWEVFyvAJdWUcNTxghPgnS30vOA5X3zK42edG3LWcSj5F6qRhNYUY1xN6eEHCJS5pfGMP 40lPg9a99uQN4ZbV87miRI5imtey79FjiZjiO9/WBYJG/DcTHZNMmkt5Knltm920qSu2Lu aPGcOeWODDrDivlCa6dujRLGaD8An1vYTU2ctHRhgfjldjHY5fzVpySdotC/3Q== 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 4W7qCn1jynz17Jx for ; Tue, 25 Jun 2024 15:55:01 +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 45PFt1mr060064 for ; Tue, 25 Jun 2024 15:55:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 45PFt1YG060063 for bugs@FreeBSD.org; Tue, 25 Jun 2024 15:55:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 279951] dhclient unable to reuse recorded lease after timeout, since 12.1 Date: Tue, 25 Jun 2024 15:55:01 +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: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: viktor.stujber+freebsd-bugs_v4CCPfay@gmail.com X-Bugzilla-Status: New 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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=3D279951 --- Comment #1 from Viktor =C5=A0tujber --- I have been made aware of a detail that changes the conclusion of the previ= ous findings. The source code change itself is reasonable; what it in fact did = is uncover an issue in dhclient-script. You see, currently, all other invokable commands in dhclient-script have no individual exit points (so no error checking and/or no failure states) and = just fall through to a catch-all 'exit_with_hooks 0'. TIMEOUT does do checking, = and as per its documentation, should exit with 0 if it thinks the saved lease is valid. Considering this, the 2019 change of the meaning of script_go()'s re= turn value still makes 'zero' the expected value for success, and the nonzero wa= it() process failure code continues to be returned as a nonzero bitmasked value.= So there's no issue there. In addition, I have misunderstood the layout of dhclient-script's TIMEOUT section. The last part that exits 1 is not the default expected path, it is= a cleanup step, and the ass-backwards if-statement structure is to avoid copy-pasting, 'goto fail;' or dummy scope constructs. It makes it difficult= to see the positive execution path, especially since it includes a negated AND condition, split into two if statements. Ultimately, what the script is doing is: 0. TIMEOUT) - so the DHCP server is not available, but we have saved leases 1. add_new_address() 2. lease must have 'routers' 3. first router on the list must be pingable 4. add_new_alias() 5. add_new_routes() 6. add_new_resolv_conf() Up until 2019-02, step 3 would fail and the script would exit, but dhclient proceeded as if it were successful because it wasn't checking the script's = exit code. This also meant that steps 4 5 and 6 weren't performed, but in my case there were no visible consequences. Now, the requirement for the gateway to= be pingable is enforced, and my host is no longer able to reuse the saved lease during an outage scenario. Unfortunately at this point I conclude that everything is now 'working as programmed', and any further discussion moves from "it's not supposed to do= X!" to "should it be doing X?" or "can it be improved", which is more about des= ign than bugfixing. I haven't thought much about how to improve this. My guess is that the ping test acts as some sort of primitive NLA / sanity check for when the host mo= ves around between networks or when the network suddenly changes ip ranges, all while the DHCP server is absent. This makes it a very strange scenario. I t= hink the power going out and the server booting up faster than the router that's also the DHCP server, is more likely. Anyway, dhclient-script and that ping test was implemented by openbsd's krw@ who also maintains dhclient and who eventually deleted the whole thing. Their current code only checks addressi= nuse and nothing else, and they're supposedly transitioning to their dhcpleased. --=20 You are receiving this mail because: You are the assignee for the bug.=