diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-05-03 17:39:01 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-05-04 08:58:43 +0200 |
commit | 81e6bcf5e0fbcac0349aea5e4b51b522aaf3774f (patch) | |
tree | b3660975054ae916be8b83adb02856740f911b3e | |
parent | 9573d600238de04cb24cd1cd90893a9e0b498244 (diff) | |
download | NetworkManager-bg/nested-slaves.tar.gz |
device: let slaves wait in IP_CONFIG until master is readybg/nested-slaves
We call nm_device_activate_stage3_ipX_start() in various places,
e.g. after a carrier change or when a master enslaves a new device to
configure IP for the device. If the device is a slave in state
IP_CONFIG, this makes it transition to IP_CHECK, while it should stay
in IP_CONFIG until the master becomes ready. When the master is ready,
it will move slaves directly to SECONDARIES, skipping IP configuration
entirely.
-rw-r--r-- | src/devices/nm-device.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4dc0edea3a..8ef7fa122f 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7775,6 +7775,12 @@ nm_device_activate_stage3_ip4_start (NMDevice *self) g_assert (priv->ip4_state == IP_WAIT); + /* Slaves stay in IP_CONFIG state until master is ready, and then + * they go directly to SECONDARIES without configuring IPv4. + */ + if (nm_active_connection_get_master (NM_ACTIVE_CONNECTION (priv->act_request))) + return TRUE; + _set_ip_state (self, AF_INET, IP_CONF); ret = NM_DEVICE_GET_CLASS (self)->act_stage3_ip4_config_start (self, &ip4_config, &failure_reason); if (ret == NM_ACT_STAGE_RETURN_SUCCESS) { @@ -7816,6 +7822,12 @@ nm_device_activate_stage3_ip6_start (NMDevice *self) g_assert (priv->ip6_state == IP_WAIT); + /* Slaves stay in IP_CONFIG state until master is ready, and then + * they go directly to SECONDARIES without configuring IPv6. + */ + if (nm_active_connection_get_master (NM_ACTIVE_CONNECTION (priv->act_request))) + return TRUE; + _set_ip_state (self, AF_INET6, IP_CONF); ret = NM_DEVICE_GET_CLASS (self)->act_stage3_ip6_config_start (self, &ip6_config, &failure_reason); if (ret == NM_ACT_STAGE_RETURN_SUCCESS) { |