From 9337a13a87dcc408eb0ca1a51997fc7ce9377078 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 11 Dec 2014 17:52:09 -0600 Subject: [PATCH] core: fix attaching managed slaves to master devices (rh #1141266) Broken by 25387cd1ffc4b3135a13e9222c0b0e5dea506c80 When an activation request comes in via D-Bus for a slave, the slave device's priv->master is set in stage1 in master_ready_cb(). Then nm_device_bring_up() is called on the slave, which triggers link_changed_cb() and device_link_changed(). That then executes this code: if (priv->master) nm_device_enslave_slave (priv->master, self, NULL); which enslaves the slave, but due to the NULL will not configure the slave. This code was only meant to be run for externally triggered master/slave changes. --- src/devices/nm-device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 23f6d46935..060a7aa6f5 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1219,10 +1219,11 @@ device_link_changed (NMDevice *self, NMPlatformLink *info) /* Update slave status for external changes */ if (priv->enslaved && info->master != nm_device_get_ifindex (priv->master)) nm_device_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_NONE); - if (info->master && !priv->enslaved) + if (info->master && !priv->enslaved) { device_set_master (self, info->master); - if (priv->master) - nm_device_enslave_slave (priv->master, self, NULL); + if (priv->master) + nm_device_enslave_slave (priv->master, self, NULL); + } if (klass->link_changed) klass->link_changed (self, info);