diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index f52262a644..740ba32006 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2442,7 +2442,23 @@ act_stage3_ip4_config_start (NMDevice *self, g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); - if ( nm_device_is_master (self) + connection = nm_device_get_connection (self); + g_assert (connection); + + /* If we did not receive IP4 configuration information, default to DHCP. + * Slaves, on the other hand, never have any IP configuration themselves, + * since the master handles all of that. + */ + s_ip4 = nm_connection_get_setting_ip4_config (connection); + if (priv->master) /* eg, device is a slave */ + method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED; + else if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + else + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; + + if ( g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) != 0 + && nm_device_is_master (self) && nm_device_is_unavailable_because_of_carrier (self)) { nm_log_info (LOGD_IP4 | LOGD_DEVICE, "(%s): IPv4 config waiting until carrier is on", @@ -2450,9 +2466,6 @@ act_stage3_ip4_config_start (NMDevice *self, return NM_ACT_STAGE_RETURN_WAIT; } - connection = nm_device_get_connection (self); - g_assert (connection); - if (priv->is_master && ip4_requires_slaves (connection)) { /* If the master has no ready slaves, and depends on slaves for * a successful IPv4 attempt, then postpone IPv4 addressing. @@ -2469,18 +2482,6 @@ act_stage3_ip4_config_start (NMDevice *self, } } - /* If we did not receive IP4 configuration information, default to DHCP. - * Slaves, on the other hand, never have any IP configuration themselves, - * since the master handles all of that. - */ - s_ip4 = nm_connection_get_setting_ip4_config (connection); - if (priv->master) /* eg, device is a slave */ - method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED; - else if (s_ip4) - method = nm_setting_ip4_config_get_method (s_ip4); - else - method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; - /* Start IPv4 addressing based on the method requested */ if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0) ret = dhcp4_start (self, connection, reason); @@ -3049,18 +3050,30 @@ act_stage3_ip6_config_start (NMDevice *self, g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); - if ( nm_device_is_master (self) - && nm_device_is_unavailable_because_of_carrier (self)) { - nm_log_info (LOGD_IP6 | LOGD_DEVICE, - "(%s): IPv6 config waiting until carrier is on", - nm_device_get_ip_iface (self)); - return NM_ACT_STAGE_RETURN_WAIT; - } + ip_iface = nm_device_get_ip_iface (self); connection = nm_device_get_connection (self); g_assert (connection); - ip_iface = nm_device_get_ip_iface (self); + /* If we did not receive IP6 configuration information, default to AUTO. + * Slaves, on the other hand, never have any IP configuration themselves, + * since the master handles all of that. + */ + s_ip6 = nm_connection_get_setting_ip6_config (connection); + if (priv->master) /* eg, device is a slave */ + method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE; + else if (s_ip6) + method = nm_setting_ip6_config_get_method (s_ip6); + else + method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + + if ( g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) != 0 + && nm_device_is_master (self) + && nm_device_is_unavailable_because_of_carrier (self)) { + nm_log_info (LOGD_IP6 | LOGD_DEVICE, + "(%s): IPv6 config waiting until carrier is on", ip_iface); + return NM_ACT_STAGE_RETURN_WAIT; + } if (priv->is_master && ip6_requires_slaves (connection)) { /* If the master has no ready slaves, and depends on slaves for @@ -3083,18 +3096,6 @@ act_stage3_ip6_config_start (NMDevice *self, priv->dhcp6_mode = IP6_DHCP_OPT_NONE; - /* If we did not receive IP6 configuration information, default to AUTO. - * Slaves, on the other hand, never have any IP configuration themselves, - * since the master handles all of that. - */ - s_ip6 = nm_connection_get_setting_ip6_config (connection); - if (priv->master) /* eg, device is a slave */ - method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE; - else if (s_ip6) - method = nm_setting_ip6_config_get_method (s_ip6); - else - method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; - if ( strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0 || strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) { if (!addrconf6_start (self)) {