From nobody Wed Oct 07 14:07:46 2026 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 4j0FM66kH3z6vy71 for ; Wed, 07 Oct 2026 14:07:46 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j0FM64ckcz3P5H for ; Wed, 07 Oct 2026 14:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791382066; 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=5ed5dRuMH4JAKuhPVMsnTXcOSr8IFiFTMALhLK/7HnY=; b=fcF+nJVhW8DcywIuJNBJbDF8IwOpk6+cg9/3X72WbF1IoZMxmUv0kgcYvxmGsnfKRe1ZBL nbnfTFTpZ84ZN+vt6MqcEx1Yo4UyhRjE3VucuEW1gRowHaUqCustSPwYQwmSg7ldD69y6/ BPaVxfGA4pZZ6l2EqqYBJf7qT9W0StYjNBy2HdXnHsVtCMrRdE6gPAMf58zRSg8LFdh24r z0nuhphruBtbXmMNM3RIVnAwSPRdgu3vo10rhtLDPS3tSHl9y2kntHv9sSH6CEi7uXnr01 Ny+nb+G5AgjPeDRWQkHu6mMaTyldaXRA/V2cJJ3SBrijoGSknuiyEbpEKX0d3g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791382066; b=KwZEWllTLWNCWdufiKSBFPggQHr1XBHww7PvtbSGOK1bYItHLWIaSsyCLwFx7yUFctycnZ 9nXf5i3Uw4XLCWTWwilK+hC46f8gjL6bAd1I8iCPBX/3V8ay/sbJ9e4Dm1Q7VbRyVbp5YR nY16FEgn/NlXqL1t5lH21dG+7gTjLBfBxSOG7s08rJjAjgS3nbPyKUwTLwtG2KnSityjhn zxuYReoo3OiCbWMYUlsh6kT8DFjIQhbKGiR8b1xoKp55B1tKXkeUg2lS9HG3Em+ZrMo9Y+ RtllqEQcSjaU2a9qXLiXuzaBbO9PiCzte24+9A7S5AOzDUYBbacECzSi2fsOJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791382066; 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=5ed5dRuMH4JAKuhPVMsnTXcOSr8IFiFTMALhLK/7HnY=; b=cL/yLKRqDSYWVJQgZ24kN+yu8/wyEq9K4p5HjLFKn8Q229f9oLo8p3rXRyre6DzBJb2St5 YdmGyyRGQp3DpfAmt7VXnhMVNOoVTIL/yzkkQR7afzHUlgkgOEoq/kkx6By+9dKRV0OOQs kND1INQcM95DysbTvNj4LEmUbCeeCJ6Fi5KZhfXpAIgvkwayU1zdkF+wtpMU7hfM2eW7T5 Wxdw4mXkP9GKnHhndcRYN2huUKSN+d1ThAS9ro7cS77ubZbLlGkHy3BfP9ROg4seSPvZjF Np6JEdnnnhQYuop6nm1DIEIyvMg3t2WSm632Q4zf3Fv/KddG9B1oRHqPqNmV3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j0FM61Ppnzx10 for ; Wed, 07 Oct 2026 14:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19ad2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 07 Oct 2026 14:07:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 0f1ca95d7740 - main - dhclient-script: store the Captive Portal URI 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f1ca95d7740e0800572ed436fd61e70f76eb6c3 Auto-Submitted: auto-generated Date: Wed, 07 Oct 2026 14:07:46 +0000 Message-Id: <6ac65232.19ad2.1f382395@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0f1ca95d7740e0800572ed436fd61e70f76eb6c3 commit 0f1ca95d7740e0800572ed436fd61e70f76eb6c3 Author: Baptiste Daroussin AuthorDate: 2026-10-02 19:55:28 +0000 Commit: Baptiste Daroussin CommitDate: 2026-10-07 14:07:09 +0000 dhclient-script: store the Captive Portal URI Write the URI received in DHCP option 114 to /var/run/captive-portal.IFACE atomically, with the legacy option 160 as a fallback, and remove the file on EXPIRE and FAIL. Reviewed by: bcr (manpage) Differential Revision: https://reviews.freebsd.org/D60259 --- sbin/dhclient/dhclient-script | 32 ++++++++++++++++++++++++++++++++ sbin/dhclient/dhclient-script.8 | 11 ++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script index 27c424e18118..b2fde6e3ed2a 100755 --- a/sbin/dhclient/dhclient-script +++ b/sbin/dhclient/dhclient-script @@ -84,6 +84,34 @@ add_new_alias() { fi } +add_captive_portal() { + # DHCP option 114 (RFC 8910), with the legacy DHCP option 160 + # (RFC 7710) as a fallback. + captive_portal_url="${new_captive_portal_url:-$new_captive_portal_legacy}" + + if [ -z "$captive_portal_url" ]; then + rm -f /var/run/captive-portal.$interface + return 0 + fi + + $LOGGER "New Captive Portal ($interface): $captive_portal_url" + + captive_portal_tmp=/var/run/captive-portal.${interface}.tmp + if ! (umask 022; echo "$captive_portal_url" > $captive_portal_tmp); then + rm -f $captive_portal_tmp + return 1 + fi + if ! mv $captive_portal_tmp /var/run/captive-portal.$interface; then + rm -f $captive_portal_tmp + return 1 + fi + return 0 +} + +delete_captive_portal() { + rm -f /var/run/captive-portal.$interface +} + fill_classless_routes() { set $1 while [ $# -ge 5 ]; do @@ -349,6 +377,7 @@ BOUND|RENEW|REBIND|REBOOT) if [ "$new_ip_address" != "$alias_ip_address" ]; then add_new_alias fi + add_captive_portal if is_default_interface; then add_new_resolv_conf fi @@ -356,6 +385,7 @@ BOUND|RENEW|REBIND|REBOOT) EXPIRE|FAIL) delete_old_alias + delete_captive_portal if [ -n "$old_ip_address" ]; then delete_old_address delete_old_routes @@ -392,6 +422,7 @@ TIMEOUT) add_new_alias fi add_new_routes + add_captive_portal if ! is_default_interface; then exit_with_hooks 0 fi @@ -402,6 +433,7 @@ TIMEOUT) fi eval "$IFCONFIG $interface inet -alias $new_ip_address $medium" delete_old_routes + delete_captive_portal exit_with_hooks 1 ;; esac diff --git a/sbin/dhclient/dhclient-script.8 b/sbin/dhclient/dhclient-script.8 index dd3efd3e8698..00482da3731c 100644 --- a/sbin/dhclient/dhclient-script.8 +++ b/sbin/dhclient/dhclient-script.8 @@ -36,7 +36,7 @@ .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. .\" -.Dd September 6, 2010 +.Dd October 5, 2026 .Dt DHCLIENT-SCRIPT 8 .Os .Sh NAME @@ -142,6 +142,15 @@ in order to make valid shell variables, and the variable names start with So for example, the new subnet mask would be passed in .Va $new_subnet_mask . .Pp +As an exception, the captive portal API URI from DHCP option 114 +.Pq see Xr dhcp-options 5 +is passed as +.Va $new_captive_portal_url . +When such a URI is received, the script also writes it to +.Pa /var/run/captive-portal. Ns Va $interface +so that it can be discovered by other programs. +The file is removed when the lease expires or is lost. +.Pp When a binding has been completed, a lot of network parameters are likely to need to be set up. A new