diff options
author | Dan Williams <dcbw@redhat.com> | 2013-11-07 01:08:02 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-11-08 16:46:45 -0600 |
commit | 76ca47e6b3908f29a1fe13b02b555d4608ff081a (patch) | |
tree | 06ec929d36ad3011c1040096caf43841423c5cfa /src/devices/nm-device-bond.c | |
parent | d6b9465b189207f8938d4b1e3738dd7431a707e8 (diff) | |
download | NetworkManager-76ca47e6b3908f29a1fe13b02b555d4608ff081a.tar.gz |
core: make assumed activations go through all the stages
Assumed slave connections need to be added to their master devices,
which didn't used to happen because the devices activating assumed
connections jumped directly to stage3, bypassing all the master/slave
handling stuff.
Instead, make all assumed connections go through all activation stages,
but make sure that things which touch the device don't get done for
assumed connections. This requires moving the master/slave code out
of the override-able class methods because we need to call the
master/slave code for assumed connections, but we don't want to call
the override-able class activation methods.
Diffstat (limited to 'src/devices/nm-device-bond.c')
-rw-r--r-- | src/devices/nm-device-bond.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 30fa54384f..8d9939b096 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -413,20 +413,23 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) } static gboolean -enslave_slave (NMDevice *device, NMDevice *slave, NMConnection *connection) +enslave_slave (NMDevice *device, + NMDevice *slave, + NMConnection *connection, + gboolean configure) { - gboolean success, no_firmware = FALSE; + gboolean success = TRUE, no_firmware = FALSE; const char *iface = nm_device_get_ip_iface (device); const char *slave_iface = nm_device_get_ip_iface (slave); nm_device_master_check_slave_physical_port (device, slave, LOGD_BOND); - nm_device_take_down (slave, TRUE); - - success = nm_platform_link_enslave (nm_device_get_ip_ifindex (device), - nm_device_get_ip_ifindex (slave)); - - nm_device_bring_up (slave, TRUE, &no_firmware); + if (configure) { + nm_device_take_down (slave, TRUE); + success = nm_platform_link_enslave (nm_device_get_ip_ifindex (device), + nm_device_get_ip_ifindex (slave)); + nm_device_bring_up (slave, TRUE, &no_firmware); + } if (success) { nm_log_info (LOGD_BOND, "(%s): enslaved bond slave %s", iface, slave_iface); |