|
|
fc9aca |
From 74b53f2f40e8656be5599a1fcd23f737dcf18bc3 Mon Sep 17 00:00:00 2001
|
|
|
fc9aca |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
fc9aca |
Date: Mon, 8 May 2017 21:22:00 +0200
|
|
|
fc9aca |
Subject: [PATCH] device: release removed devices from master on cleanup
|
|
|
fc9aca |
|
|
|
fc9aca |
On cleanup, unconditionally release a device from its master if the
|
|
|
fc9aca |
link is missing or it doesn't have a master, otherwise the master
|
|
|
fc9aca |
would later try to release the slave, hitting the following assertion:
|
|
|
fc9aca |
|
|
|
fc9aca |
"nm_platform_link_release: assertion 'slave > 0' failed"
|
|
|
fc9aca |
#0 g_logv
|
|
|
fc9aca |
#1 g_log
|
|
|
fc9aca |
#2 g_return_if_fail_warning
|
|
|
fc9aca |
#3 nm_platform_link_release
|
|
|
fc9aca |
#4 release_slave
|
|
|
fc9aca |
#5 nm_device_master_release_one_slave
|
|
|
fc9aca |
#6 slave_state_changed
|
|
|
fc9aca |
#7 ffi_call_unix64
|
|
|
fc9aca |
#8 ffi_call
|
|
|
fc9aca |
#9 g_cclosure_marshal_generic
|
|
|
fc9aca |
#10 g_closure_invoke
|
|
|
fc9aca |
#11 signal_emit_unlocked_R
|
|
|
fc9aca |
#12 g_signal_emit_valist
|
|
|
fc9aca |
#14 _set_state_full
|
|
|
fc9aca |
#15 nm_device_state_changed
|
|
|
fc9aca |
#16 nm_device_unrealize
|
|
|
fc9aca |
#17 _platform_link_cb_idle
|
|
|
fc9aca |
#18 g_main_context_dispatch
|
|
|
fc9aca |
#19 g_main_context_dispatch
|
|
|
fc9aca |
#20 g_main_context_iterate
|
|
|
fc9aca |
#21 g_main_loop_run
|
|
|
fc9aca |
#22 main
|
|
|
fc9aca |
|
|
|
fc9aca |
Fixes: 9e8218f99a2d5a7020703e0fbac1c7c0983930db
|
|
|
fc9aca |
|
|
|
fc9aca |
https://bugzilla.redhat.com/show_bug.cgi?id=1448907
|
|
|
fc9aca |
(cherry picked from commit 3355a2823be11b15d8f3cf1d2f080ab83739f17d)
|
|
|
fc9aca |
(cherry picked from commit 6110b11235c932b94b0114ff90e8438ffedd2bfb)
|
|
|
fc9aca |
---
|
|
|
fc9aca |
src/devices/nm-device.c | 10 +++++-----
|
|
|
fc9aca |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
fc9aca |
|
|
|
fc9aca |
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
|
|
|
fc9aca |
index 37b2588..f5eb71d 100644
|
|
|
fc9aca |
--- a/src/devices/nm-device.c
|
|
|
fc9aca |
+++ b/src/devices/nm-device.c
|
|
|
fc9aca |
@@ -12096,11 +12096,6 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean
|
|
|
fc9aca |
/* master: release slaves */
|
|
|
fc9aca |
nm_device_master_release_slaves (self);
|
|
|
fc9aca |
|
|
|
fc9aca |
- /* slave: mark no longer enslaved */
|
|
|
fc9aca |
- if ( priv->master
|
|
|
fc9aca |
- && nm_platform_link_get_master (nm_device_get_platform (self), priv->ifindex) <= 0)
|
|
|
fc9aca |
- nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
|
|
fc9aca |
-
|
|
|
fc9aca |
/* Take out any entries in the routing table and any IP address the device had. */
|
|
|
fc9aca |
ifindex = nm_device_get_ip_ifindex (self);
|
|
|
fc9aca |
if (ifindex > 0) {
|
|
|
fc9aca |
@@ -12109,6 +12104,11 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean
|
|
|
fc9aca |
}
|
|
|
fc9aca |
}
|
|
|
fc9aca |
|
|
|
fc9aca |
+ /* slave: mark no longer enslaved */
|
|
|
fc9aca |
+ if ( priv->master
|
|
|
fc9aca |
+ && nm_platform_link_get_master (nm_device_get_platform (self), priv->ifindex) <= 0)
|
|
|
fc9aca |
+ nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
|
|
fc9aca |
+
|
|
|
fc9aca |
if (priv->lldp_listener)
|
|
|
fc9aca |
nm_lldp_listener_stop (priv->lldp_listener);
|
|
|
fc9aca |
|
|
|
fc9aca |
--
|
|
|
fc9aca |
2.9.3
|
|
|
fc9aca |
|