diff --git a/src/nm-policy.c b/src/nm-policy.c index 55effd5c52..b47343cc20 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1364,9 +1364,6 @@ device_state_changed (NMDevice *device, NMIP6Config *ip6_config; NMSettingConnection *s_con; - if (connection) - nm_settings_connection_set_autoconnect_blocked_reason (connection, NM_DEVICE_STATE_REASON_NONE); - switch (new_state) { case NM_DEVICE_STATE_FAILED: /* Mark the connection invalid if it failed during activation so that @@ -1460,6 +1457,10 @@ device_state_changed (NMDevice *device, * activation. */ activate_slave_connections (policy, device); break; + case NM_DEVICE_STATE_IP_CONFIG: + /* We must have secrets if we got here. */ + nm_settings_connection_set_autoconnect_blocked_reason (connection, NM_DEVICE_STATE_REASON_NONE); + break; case NM_DEVICE_STATE_SECONDARIES: s_con = nm_connection_get_setting_connection (NM_CONNECTION (connection)); if (s_con && nm_setting_connection_get_num_secondaries (s_con) > 0) {