core: fix dhcp leases in l3cd cloning.

This will copy DHCP lease from src (not self), fixing an assertion in
nm_l3_config_data_new_clone.

Resolves: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1620
Fixes: 55b722820d ('l3cfg: fix nm_l3_config_data_new_clone() to make exact copy')
This commit is contained in:
Martin von Gagern
2024-09-10 21:54:19 +01:00
parent 70868fb469
commit a25d593922

View File

@@ -3480,8 +3480,8 @@ nm_l3_config_data_merge(NML3ConfigData *self,
g_steal_pointer(&self->dhcp_lease_x[1]);
self->source = src->source;
self->dhcp_lease_x[0] = nm_dhcp_lease_ref(self->dhcp_lease_x[0]);
self->dhcp_lease_x[1] = nm_dhcp_lease_ref(self->dhcp_lease_x[1]);
self->dhcp_lease_x[0] = nm_dhcp_lease_ref(src->dhcp_lease_x[0]);
self->dhcp_lease_x[1] = nm_dhcp_lease_ref(src->dhcp_lease_x[1]);
}
if (!src->allow_routes_without_address_4)
self->allow_routes_without_address_4 = FALSE;