From 72b5b63930efd4142433e8278f16de208a709617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20P=C3=BCschel?= Date: Tue, 10 Feb 2026 12:13:34 +0100 Subject: [PATCH] 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. --- src/libnm-core-impl/nm-setting-ip6-config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libnm-core-impl/nm-setting-ip6-config.c b/src/libnm-core-impl/nm-setting-ip6-config.c index c68be991b2..9607a28f14 100644 --- a/src/libnm-core-impl/nm-setting-ip6-config.c +++ b/src/libnm-core-impl/nm-setting-ip6-config.c @@ -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) {