summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-12-11 17:52:09 -0600
committerDan Williams <dcbw@redhat.com>2014-12-11 17:56:04 -0600
commit9337a13a87dcc408eb0ca1a51997fc7ce9377078 (patch)
tree7749f76190d593368b53369f3c166b65fde2c25f
parent7d5c0db53abacc9a5ca5a0f56d83dc49c2e64f90 (diff)
downloadNetworkManager-9337a13a87dcc408eb0ca1a51997fc7ce9377078.tar.gz
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.
-rw-r--r--src/devices/nm-device.c7
1 files 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);