summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-09-02 16:47:59 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-09-02 16:52:58 +0200
commit3c8011b0e30653133b20301cf5263b8d63b50dc9 (patch)
tree31753c399f750a560b1a04ca202731f104c3b0fd
parent74a7626940b3ac0e7439681c5fc032896b511e3f (diff)
downloadNetworkManager-bg/rh1747998.tar.gz
device: fix crash when master connection failsbg/rh1747998
When the master AC becomes ready, activate_stage1_device_prepare() is called in a idle handler. If the master AC fails in the meantime, it will change state to deactivating or deactivated. We must check for that condition before proceeding with slave activation. Note the the 'master_ready' flag of an AC is never cleared after it is set. Fixes: 5b677d5a3bed ('device: move check for master from nm_device_activate_schedule_stage2_device_config() to end of stage1') https://bugzilla.redhat.com/show_bug.cgi?id=1747998
-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 0872f5a6e2..5310290743 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6596,13 +6596,13 @@ activate_stage1_device_prepare (NMDevice *self)
active = NM_ACTIVE_CONNECTION (priv->act_request.obj);
master = nm_active_connection_get_master (active);
if (master) {
+ if (nm_active_connection_get_state (master) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
+ _LOGD (LOGD_DEVICE, "master connection is deactivating");
+ nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED);
+ return;
+ }
/* If the master connection is ready for slaves, attach ourselves */
if (!nm_active_connection_get_master_ready (active)) {
- if (nm_active_connection_get_state (master) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
- _LOGD (LOGD_DEVICE, "master connection is deactivating");
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED);
- return;
- }
if (priv->master_ready_id == 0) {
_LOGD (LOGD_DEVICE, "waiting for master connection to become ready");
priv->master_ready_id = g_signal_connect (active,