Hi Mohamed,

On Mon, Dec 20, 2010 at 11:07:34AM -0800, Mohamed Abbas wrote:
> This patch fix the race condition that caused more than one service
> to start connecting at the same fime by:
> 
> * Make sure is_connecting always returning the right status of
> the network and dont allow the small intevel until get the
> G_SUPPLICANT_STATE_AUTHENTICATING or G_SUPPLICANT_STATE_ASSOCIATING
> signal from supplicant.
> 
> * Fix serving soring so connecting service will make it in the top
> so auto_connect search will work.
> 
> * Dont need device->connected in end scan to decide to call
> auto_connect.
> 
> This patch used Samuel patch and add to it.
>        case CONNMAN_SERVICE_STATE_UNKNOWN:
>         case CONNMAN_SERVICE_STATE_IDLE:
>         case CONNMAN_SERVICE_STATE_FAILURE:
> +               if (service->network != NULL)
> +                       return __connman_network_get_connecting(
> +                                                       service->network);
>         case CONNMAN_SERVICE_STATE_DISCONNECT:
The patch by itself looks fine to me. However, I'd like to see it splitted in
2: 1 for the network.c and service.c changes and then another one for not
using disconnected anymore.

Also, I have one more request:

> diff --git a/src/network.c b/src/network.c
> index 57d873a..81f963e 100644
> --- a/src/network.c
> +++ b/src/network.c
> @@ -896,10 +896,10 @@ int __connman_network_connect(struct connman_network 
> *network)
>       if (network->device == NULL)
>               return -ENODEV;
>  
> -     __connman_device_disconnect(network->device);
> -
>       network->connecting = TRUE;
>  
> +     __connman_device_disconnect(network->device);
> +
Could we please add some comment here to describe the race we're trying to fix
by setting connecting before calling __connman_device_disconnect().

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to