summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-05-08 21:22:00 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-05-24 13:39:27 +0200
commit3355a2823be11b15d8f3cf1d2f080ab83739f17d (patch)
tree5e2e1e67761005e84584fdccf60479e0693cb027
parentc73b39c3a6626dbba0c018014123ae8b97fb6abc (diff)
downloadNetworkManager-3355a2823be11b15d8f3cf1d2f080ab83739f17d.tar.gz
device: release removed devices from master on cleanup
On cleanup, unconditionally release a device from its master if the link is missing or it doesn't have a master, otherwise the master would later try to release the slave, hitting the following assertion: "nm_platform_link_release: assertion 'slave > 0' failed" #0 g_logv #1 g_log #2 g_return_if_fail_warning #3 nm_platform_link_release #4 release_slave #5 nm_device_master_release_one_slave #6 slave_state_changed #7 ffi_call_unix64 #8 ffi_call #9 g_cclosure_marshal_generic #10 g_closure_invoke #11 signal_emit_unlocked_R #12 g_signal_emit_valist #14 _set_state_full #15 nm_device_state_changed #16 nm_device_unrealize #17 _platform_link_cb_idle #18 g_main_context_dispatch #19 g_main_context_dispatch #20 g_main_context_iterate #21 g_main_loop_run #22 main Fixes: 9e8218f99a2d5a7020703e0fbac1c7c0983930db https://bugzilla.redhat.com/show_bug.cgi?id=1448907
-rw-r--r--src/devices/nm-device.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 8473364a36..2fccf50c75 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -12040,11 +12040,6 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean
/* master: release slaves */
nm_device_master_release_slaves (self);
- /* slave: mark no longer enslaved */
- if ( priv->master
- && nm_platform_link_get_master (nm_device_get_platform (self), priv->ifindex) <= 0)
- nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
-
/* Take out any entries in the routing table and any IP address the device had. */
ifindex = nm_device_get_ip_ifindex (self);
if (ifindex > 0) {
@@ -12053,6 +12048,11 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean
}
}
+ /* slave: mark no longer enslaved */
+ if ( priv->master
+ && nm_platform_link_get_master (nm_device_get_platform (self), priv->ifindex) <= 0)
+ nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
+
if (priv->lldp_listener)
nm_lldp_listener_stop (priv->lldp_listener);