mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 02:08:02 +02:00
libnm/client: don't reset properties when interface goes away
In case the D-Bus interfaces start dropping off (typically all off them go one by one when the object is being deleted), don't reset all the properties. In particular, keep most properties around, only tear down "o" and "ao", so that the object dependencies get torn down, but we still get enough properties around to identify what the dead object was its heyday. One example of where this is not good is when the device-removed signal is emmitted, the device no longer has the ifname: $ nmcli monitor <quit NetworkManager> (null): device removed (null): device removed ...
This commit is contained in:
parent
db6f2b12f5
commit
4d7c74c74a
2 changed files with 11 additions and 5 deletions
|
|
@ -2630,7 +2630,16 @@ _obj_handle_dbus_iface_changes(NMClient *self,
|
|||
|
||||
if (is_removed) {
|
||||
for (i_prop = 0; i_prop < db_iface_data->dbus_iface.meta->n_dbus_properties; i_prop++) {
|
||||
_obj_handle_dbus_prop_changes(self, dbobj, db_iface_data, i_prop, NULL);
|
||||
const GVariantType *dbus_type =
|
||||
db_iface_data->dbus_iface.meta->dbus_properties[i_prop].dbus_type;
|
||||
|
||||
/* Unset properties that can potentially contain objects, to release them,
|
||||
* but keep the rest around, because it might still make sense to know what
|
||||
* they were (e.g. when a device has been removed we'd like know what interface
|
||||
* name it had, or keep the state to avoid spurious state change into UNKNOWN). */
|
||||
if (g_variant_type_is_array(dbus_type)
|
||||
|| g_variant_type_equal(dbus_type, G_VARIANT_TYPE_OBJECT_PATH))
|
||||
_obj_handle_dbus_prop_changes(self, dbobj, db_iface_data, i_prop, NULL);
|
||||
}
|
||||
} else {
|
||||
while ((db_prop_data = c_list_first_entry(&db_iface_data->changed_prop_lst_head,
|
||||
|
|
|
|||
|
|
@ -1913,11 +1913,8 @@ class TestNmcli(NmTestBase):
|
|||
nmc = start_mon()
|
||||
self.srv.shutdown()
|
||||
self.srv = None
|
||||
nmc.expect("\(null\): device removed")
|
||||
nmc.expect("eth0: device removed")
|
||||
nmc.expect("con-1: connection profile removed")
|
||||
nmc.expect("Hostname set to '\(null\)'")
|
||||
nmc.expect("Networkmanager is now in the 'unknown' state")
|
||||
nmc.expect("Connectivity is now 'unknown'")
|
||||
nmc.expect("NetworkManager is stopped")
|
||||
end_mon(nmc)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue