diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-05-03 17:39:01 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-05-04 10:28:27 +0200 |
commit | 41f6540afd9d49023685d6be4ee26e245859fe71 (patch) | |
tree | 33b50a34d6c098c85e46f5a20c97c263e14e73e9 | |
parent | f5d29e6f61fd9ff145aaf48f6b804e4b15fb48fb (diff) | |
download | NetworkManager-41f6540afd9d49023685d6be4ee26e245859fe71.tar.gz |
device: let slaves wait in IP_CONFIG until master is ready
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 603924558c..eae1a30d32 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) { |