core: fix attaching managed slaves to master devices (rh #1141266)

Broken by 25387cd1ff

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.
This commit is contained in:
Dan Williams 2014-12-11 17:52:09 -06:00
parent 7d5c0db53a
commit 9337a13a87

View file

@ -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);