From 41f6540afd9d49023685d6be4ee26e245859fe71 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 3 May 2017 17:39:01 +0200 Subject: 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. --- src/devices/nm-device.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/devices/nm-device.c') 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) { -- cgit v1.2.1