From 5402a7217964205aa6041324fa0fd393bfbb4838 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 7 Mar 2022 08:42:06 +0100 Subject: [PATCH] dhcp6: fix setting ifindex in nm_dhcp_utils_merge_new_dhcp6_lease() nm_l3_config_data_new_clone() takes non-positive ifindex to use the ifindex of the l3cd. But it also asserts that the ifindex is not negative. Fix that assertion failure, by setting the ifindex to zero. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/907 Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration') --- src/core/dhcp/nm-dhcp-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/dhcp/nm-dhcp-utils.c b/src/core/dhcp/nm-dhcp-utils.c index 4a138086b9..214e94cd08 100644 --- a/src/core/dhcp/nm-dhcp-utils.c +++ b/src/core/dhcp/nm-dhcp-utils.c @@ -876,7 +876,7 @@ nm_dhcp_utils_merge_new_dhcp6_lease(const NML3ConfigData *l3cd_old, * addresses from the same transaction into a single configuration. **/ - l3cd_merged = nm_l3_config_data_new_clone(l3cd_old, -1); + l3cd_merged = nm_l3_config_data_new_clone(l3cd_old, 0); nm_l3_config_data_iter_ip6_address_for_each (&iter, l3cd_new, &addr) nm_l3_config_data_add_address_6(l3cd_merged, addr);