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:
Tim Spriggs 2026-05-08 06:30:21 +00:00
commit 6508fcd26a
2 changed files with 26 additions and 22 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_addresses = FALSE;
nm_assert(lease);
@ -107,8 +108,29 @@ 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_addresses = TRUE;
}
}
if (!config->v6.info_only) {
gboolean has_any_addresses = FALSE;
uint64_t lft_pref;
uint64_t lft_valid;
@ -166,27 +188,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);