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: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
This commit is contained in:
Thomas Haller 2022-03-07 08:42:06 +01:00
parent 8384afa875
commit 5402a72179
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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);