merge: branch 'ts/issue-1948'

IPv6 link with RA and PD should be healthy

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2404
This commit is contained in:
Íñigo Huguet 2026-05-18 05:50:11 +00:00
commit 066a1405d3
2 changed files with 28 additions and 23 deletions

3
NEWS
View file

@ -64,6 +64,9 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
* Allow configuring all bond options in nmtui by introducing a
"other options" field, which covers options not already covered by a
dedicated input field.
* IPv6 interfaces that receive PD via DHCPv6 are considered healthy without a
non-temporary address. The delegated prefix can be used via an interface
configured with "ipv6.method: shared"
=============================================
NetworkManager-1.56

View file

@ -92,6 +92,7 @@ lease_to_ip6_config(NMDhcpSystemd *self, sd_dhcp6_lease *lease, gint32 ts, GErro
const char *s;
nm_auto_free_gstring GString *str = NULL;
int num, i;
gboolean has_any_prefix_delegated = FALSE;
nm_assert(lease);
@ -107,6 +108,28 @@ lease_to_ip6_config(NMDhcpSystemd *self, sd_dhcp6_lease *lease, gint32 ts, GErro
NM_DHCP_OPTION_DHCP6_NM_IAID,
nm_dhcp_iaid_to_hexstr(config->v6.iaid, iaid_buf));
{
struct in6_addr prefix;
uint8_t prefix_len;
nm_gstring_prepare(&str);
sd_dhcp6_lease_pd_iterator_reset(lease);
while (!sd_dhcp6_lease_get_pd_prefix(lease, &prefix, &prefix_len)) {
nm_gstring_add_space_delimiter(str);
nm_inet6_ntop(&prefix, addr_str);
g_string_append_printf(str, "%s/%u", addr_str, prefix_len);
sd_dhcp6_lease_pd_iterator_next(lease);
}
if (str->len > 0) {
nm_dhcp_option_add_option(options,
TRUE,
AF_INET6,
NM_DHCP_OPTION_DHCP6_IA_PD,
str->str);
has_any_prefix_delegated = TRUE;
}
}
if (!config->v6.info_only) {
gboolean has_any_addresses = FALSE;
uint64_t lft_pref;
@ -142,11 +165,11 @@ lease_to_ip6_config(NMDhcpSystemd *self, sd_dhcp6_lease *lease, gint32 ts, GErro
str->str);
}
if (!has_any_addresses) {
if (!has_any_addresses && !has_any_prefix_delegated) {
g_set_error_literal(error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
"no address received in managed mode");
"no address or prefix delegation received in managed mode");
return NULL;
}
}
@ -166,27 +189,6 @@ lease_to_ip6_config(NMDhcpSystemd *self, sd_dhcp6_lease *lease, gint32 ts, GErro
str->str);
}
{
struct in6_addr prefix;
uint8_t prefix_len;
nm_gstring_prepare(&str);
sd_dhcp6_lease_pd_iterator_reset(lease);
while (!sd_dhcp6_lease_get_pd_prefix(lease, &prefix, &prefix_len)) {
nm_gstring_add_space_delimiter(str);
nm_inet6_ntop(&prefix, addr_str);
g_string_append_printf(str, "%s/%u", addr_str, prefix_len);
sd_dhcp6_lease_pd_iterator_next(lease);
}
if (str->len > 0) {
nm_dhcp_option_add_option(options,
TRUE,
AF_INET6,
NM_DHCP_OPTION_DHCP6_IA_PD,
str->str);
}
}
num = sd_dhcp6_lease_get_domains(lease, &domains);
if (num > 0) {
nm_gstring_prepare(&str);