Hi Mohamed,
On Thu, Oct 21, 2010 at 10:48:31AM -0700, Mohamed Abbas wrote:
> while associating then the user disconnect the network this will
> cause the following:
> 1- __connman_service_disconnect() which will call
> 2- __connman_network_disconnect() which call
> 3 err = network->driver->disconnect(network);
> 4- connman_network_set_connected(network, FALSE);
>
> looking at connman_network_set_connected code
> if ((network->connecting == TRUE || network->associating == TRUE) &&
> connected == FALSE) {
> connman_element_set_error(&network->element,
> CONNMAN_ELEMENT_ERROR_CONNECT_FAILED);
> __connman_network_disconnect(network);
> }
>
> network->associating is TRUE and this will case to go to step 2 which
> case the deadlock since this will keep looping and preventing to service
> any supplicant dbus message to come in and break the deadlock.
My comments below:
> diff --git a/plugins/wifi.c b/plugins/wifi.c
> index a159a9d..6fba131 100644
> --- a/plugins/wifi.c
> +++ b/plugins/wifi.c
> @@ -334,10 +334,17 @@ static void interface_state(GSupplicantInterface
> *interface)
> case G_SUPPLICANT_STATE_DISCONNECTED:
> connman_network_set_associating(network, FALSE);
> connman_network_set_connected(network, FALSE);
> +
> + connman_network_unref(wifi->network);
> + wifi->network = NULL;
> +
> break;
>
> case G_SUPPLICANT_STATE_INACTIVE:
> connman_network_set_associating(network, FALSE);
> + connman_network_unref(wifi->network);
> +
> + wifi->network = NULL;
> break;
Why do we need to move the network unref from the disconnect callback to here?
How is that related to the deadlock ?
> @@ -617,6 +618,8 @@ static int network_disconnect(struct connman_network
> *network)
> if (wifi == NULL || wifi->interface == NULL)
> return -ENODEV;
>
> + connman_network_set_associating(network, FALSE);
> +
This one makes sense. I'll apply this patch once I get an explanation from you
about the network unref move.
Thanks a lot.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman