From f9feddbcf024b4072aef8ebadc04cd5ccf11d2d0 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 28 Jun 2016 14:12:57 +0200 Subject: [PATCH] device: cancel pending activation when slave is released Since nm_device_slave_notify_release() is called from outside the activation chain of the slave device (it gets called from the master device) there might be pending activation sources scheduled, clear them before queueing a state change. --- src/devices/nm-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index f107dc35f..4e955076a 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -455,8 +455,8 @@ static gboolean dhcp6_start (NMDevice *self, gboolean wait_for_ll, NMDeviceState static void nm_device_start_ip_check (NMDevice *self); static void realize_start_setup (NMDevice *self, const NMPlatformLink *plink); static void nm_device_set_mtu (NMDevice *self, guint32 mtu); - static void dhcp_schedule_restart (NMDevice *self, int family, const char *reason); +static void _cancel_activation (NMDevice *self); /***********************************************************/ @@ -2810,6 +2810,8 @@ nm_device_slave_notify_release (NMDevice *self, NMDeviceStateReason reason) nm_connection_get_id (connection), master_status); + /* Cancel any pending activation sources */ + _cancel_activation (self); nm_device_queue_state (self, new_state, reason); } else _LOGI (LOGD_DEVICE, "released from master device %s", nm_device_get_iface (priv->master));