dhclient: export the Captive Portal URI to the script

Differential Revision=	https://reviews.freebsd.org/D60259
This commit is contained in:
Baptiste Daroussin committed 2026-10-07 16:07:09 +02:00
1 parent afee6fb209
commit 7ba7285593
1 file changed
+14 -3
+14 -3
View File
@@ -2431,10 +2431,21 @@ supersede:
if (len) {
char name[256];
if (dhcp_option_ev_name(name, sizeof(name),
/*
* The option is named "captive-portal", so the
* generic name derived below would be
* new_captive_portal / old_captive_portal.
* Append "_url" suffix so that the variable name
* says that the value is a URL.
*/
if (i == DHO_CAPTIVE_PORTAL)
strlcpy(name, "captive_portal_url",
sizeof(name));
else if (!dhcp_option_ev_name(name, sizeof(name),
&dhcp_options[i]))
script_set_env(ip->client, prefix, name,
pretty_print_option(i, dp, len, 0, 0));
continue;
script_set_env(ip->client, prefix, name,
pretty_print_option(i, dp, len, 0, 0));
}
}
snprintf(tbuf, sizeof(tbuf), "%d", (int)lease->expiry);