if (connman_device_add_network(device, network) != 0)
goto error;
- if (active)
+ /* Connect only if requested to do so */
+ if (active && connman_network_get_connecting(network) == TRUE)
set_connected(info, active);
return 0;
dbus_message_iter_get_basic(&value, &active);
- set_connected(info, active);
+ if (active == FALSE)
+ set_connected(info, active);
+
+ /* Connect only if requested to do so */
+ if (active == TRUE &&
+ connman_network_get_connecting(info->network) == TRUE)
+ set_connected(info, active);
}
return TRUE;