From 86f005ea4b646b21ad2cf8ffdb783e72bff76065 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 18 Feb 2016 13:43:37 +0100 Subject: [PATCH] device: fix assertion on unmanaged_mask for slave devices When executing these commands: ip link add br0 type bridge ip link set dev br0 up ip link add dummy1 type dummy ip link set dev dummy1 up ip addr add 1.1.1.1/24 dev br0 brctl addif br0 dummy1 sleep 1 ip link del br0 ip link del dummy1 the following assertion was failing: nm_device_master_release_one_slave: runtime check failed: (NM_FLAGS_HAS (slave_priv->unmanaged_mask, NM_UNMANAGED_IS_SLAVE)) #0 g_logv() #1 g_log() #2 g_warn_message() #3 nm_device_master_release_one_slave() #4 nm_device_cleanup() #5 _set_state_full() #6 nm_device_state_changed() #7 nm_device_unrealize() #8 _platform_link_cb_idle() #9 g_main_context_dispatch() #10 g_main_context_dispatch() #11 g_main_context_iterate() #12 g_main_loop_run() #13 main() Upon slave removal we unrealize the device, resetting the unmanaged flags to NM_UNMANAGED_PLATFORM_INIT, then we clean up the device and call nm_device_master_release_one_slave(), which asserts the presence of NM_UNMANAGED_IS_SLAVE flag cleared just before. Drop the check. Fixes: 87a3df2e572ed47b5f76f6d1cad63ce622296e21 --- src/devices/nm-device.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 21e653df43..2389015528 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1185,8 +1185,6 @@ nm_device_master_release_one_slave (NMDevice *self, NMDevice *slave, gboolean co * when slaves change. */ nm_device_update_hw_address (self); - - g_warn_if_fail (NM_FLAGS_HAS (slave_priv->unmanaged_mask, NM_UNMANAGED_IS_SLAVE)); nm_device_set_unmanaged_by_flags (slave, NM_UNMANAGED_IS_SLAVE, NM_UNMAN_FLAG_OP_FORGET, NM_DEVICE_STATE_REASON_REMOVED); }