ip6: disallow setting ipv6.dhcp-request-options

Disallow setting the ipv6.dhcp-request-options by verifying that no
value has been set. This is neccessary, as the option is currently not
supported, but may be supported in the future.

The problem implementing the DHCPv6 support is that NetworkManager
currently uses the systemd DHCPv6 implementation. But in order to access
the option data (already parsed by systemd) we would need to include
private systemd headers, as the necessary functions or structures are
not exposed in the currently included headers. As the long term goal is
to replace the DHCPv6 implementation, the setting is kept for ipv4/ipv6
so it can be implemented quickly when a new DHCPv6 implementation is
added.
This commit is contained in:
Sven Püschel 2026-02-10 12:13:34 +01:00
parent 75c1ddce19
commit 72b5b63930

View file

@ -464,6 +464,18 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
if (nm_setting_ip_config_has_dhcp_request_options(s_ip)) {
g_set_error_literal(error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("Requesting additional DHCPv6 options is not supported for IPv6"));
g_prefix_error(error,
"%s.%s: ",
NM_SETTING_IP6_CONFIG_SETTING_NAME,
NM_SETTING_IP_CONFIG_DHCP_REQUEST_OPTIONS);
return FALSE;
}
/* Failures from here on, are NORMALIZABLE_ERROR... */
if (token_needs_normalization) {