</listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>UseCaptivePortal=</varname></term>
+ <listitem>
+ <para>When true (the default), the captive portal advertised by the DHCPv6 server will be recorded
+ and made available to client programs and displayed in the networkctl status output per-link.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>UseDelegatedPrefix=</varname></term>
<listitem>
return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to request domains: %m");
}
+ if (link->network->dhcp6_use_captive_portal > 0) {
+ r = sd_dhcp6_client_set_request_option(client, SD_DHCP6_OPTION_CAPTIVE_PORTAL);
+ if (r < 0)
+ return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to request captive portal: %m");
+ }
+
if (link->network->dhcp6_use_ntp) {
r = sd_dhcp6_client_set_request_option(client, SD_DHCP6_OPTION_NTP_SERVER);
if (r < 0)
DHCPv6.UseHostname, config_parse_bool, 0, offsetof(Network, dhcp6_use_hostname)
DHCPv6.UseDomains, config_parse_dhcp_use_domains, AF_INET6, 0
DHCPv6.UseNTP, config_parse_dhcp_use_ntp, AF_INET6, 0
+DHCPv6.UseCaptivePortal, config_parse_bool, 0, offsetof(Network, dhcp6_use_captive_portal)
DHCPv6.MUDURL, config_parse_mud_url, 0, offsetof(Network, dhcp6_mudurl)
DHCPv6.RequestOptions, config_parse_dhcp_request_options, AF_INET6, 0
DHCPv6.UserClass, config_parse_dhcp_user_or_vendor_class, AF_INET6, offsetof(Network, dhcp6_user_class)
.dhcp6_use_dns = true,
.dhcp6_use_hostname = true,
.dhcp6_use_ntp = true,
+ .dhcp6_use_captive_portal = true,
.dhcp6_use_rapid_commit = true,
.dhcp6_duid.type = _DUID_TYPE_INVALID,
.dhcp6_client_start_mode = _DHCP6_CLIENT_START_MODE_INVALID,
bool dhcp6_use_hostname;
bool dhcp6_use_ntp;
bool dhcp6_use_ntp_set;
+ bool dhcp6_use_captive_portal;
bool dhcp6_use_rapid_commit;
DHCPUseDomains dhcp6_use_domains;
bool dhcp6_use_domains_set;
int link_save(Link *link) {
const char *admin_state, *oper_state, *carrier_state, *address_state, *ipv4_address_state, *ipv6_address_state,
- *dhcp_captive_portal = NULL;
+ *dhcp_captive_portal = NULL, *dhcp6_captive_portal = NULL;
_cleanup_(unlink_and_freep) char *temp_path = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
return r;
}
+ if (link->dhcp6_lease && link->network->dhcp6_use_captive_portal) {
+ r = sd_dhcp6_lease_get_captive_portal(link->dhcp6_lease, &dhcp6_captive_portal);
+ if (r < 0 && r != -ENODATA)
+ return r;
+ }
+
+ if (dhcp6_captive_portal && dhcp_captive_portal && !streq(dhcp_captive_portal, dhcp6_captive_portal))
+ log_link_warning(link, "DHCPv6 Captive Portal (%s) does not match DHCPv4 (%s). Ignoring DHCPv6 portal.",
+ dhcp6_captive_portal, dhcp_captive_portal);
+
+
if (dhcp_captive_portal)
fprintf(f, "CAPTIVE_PORTAL=%s\n", dhcp_captive_portal);
+ else if (dhcp6_captive_portal)
+ fprintf(f, "CAPTIVE_PORTAL=%s\n", dhcp6_captive_portal);
/************************************************************/