Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Re: [PATCH] network: Set service->favorite to false when
      invalid key error is set (Naveen Singh)
   2. Re: [PATCH] network: Set service->favorite to false when
      invalid key error is set (Patrik Flykt)


----------------------------------------------------------------------

Message: 1
Date: Wed, 6 Apr 2016 13:35:30 -0700
From: Naveen Singh <[email protected]>
To: Saurav Babu <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH] network: Set service->favorite to false when
        invalid key error is set
Message-ID:
        <cafk1zrd0u_a_2ej074cvta7v9m+d7qdbcfkye_admphw_sm...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Tue, Apr 5, 2016 at 9:35 PM, Saurav Babu <[email protected]> wrote:

> In following scenario connman continuously tries to auto connect to AP:
>  1. Connect to an AP.
>  2. Change AP Password.
>  3. Disconnection occurs and then connman always tries to autoconnect and
> fails due to invalid key.
>
> This patch sets service->favorite property to false on receiving invalid
> key error so that connman never tries to autoconnect again to that AP
> until it has been successfully connected again.
> ---
>  src/network.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/network.c b/src/network.c
> index db3d2f3..df2115c 100644
> --- a/src/network.c
> +++ b/src/network.c
> @@ -1223,6 +1223,8 @@ static void set_invalid_key_error(struct
> connman_network *network)
>
>         service = connman_service_lookup_from_network(network);
>
> +       __connman_service_set_favorite(service, false);
> +
>         __connman_service_indicate_error(service,
>                                         CONNMAN_SERVICE_ERROR_INVALID_KEY);
>  }
>
In this particular case, service state will be left to failure and hence
the connection will not happen. The way it expects to work is as following:
1) Change the passphrase
2) AP disconnects and the next connect attempt fails with error property
set to "invalid-key" and state is set to failure.
3) Application should not clear the error property in this case.
4) User should be notified and right passphrase should be input.
5) On the next connect attempt service->error would be still set
to CONNMAN_SERVICE_ERROR_INVALID_KEY and then __connman_service_needs_input
would be called from __connman_service_connect.
6) User input new passphrase will be supplied and then service->error would
be cleared and connect would happen.

The key here is that application on top of connman should not be clearing
the error property on invalid_key. If you clear that error, connman would
just keep using the old keys.

Changing the favorite flag is not the right thing to do here.

Regards
Naveen

> --
> 1.9.1
>
> _______________________________________________
> connman mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/connman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.01.org/pipermail/connman/attachments/20160406/44b954d5/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 07 Apr 2016 12:31:32 +0300
From: Patrik Flykt <[email protected]>
To: Naveen Singh <[email protected]>, Saurav Babu
        <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH] network: Set service->favorite to false when
        invalid key error is set
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Wed, 2016-04-06 at 13:35 -0700, Naveen Singh wrote:
> In this particular case, service state will be left to failure and
> hence the connection will not happen. The way it expects to work is
> as following:
> 1) Change the passphrase
> 2) AP disconnects and the next connect attempt fails with error
> property set to "invalid-key" and state is set to failure.
> 3) Application should not clear the error property in this case.?
> 4) User should be notified and right passphrase should be input.
> 5) On the next connect attempt service->error would be still set
> to?CONNMAN_SERVICE_ERROR_INVALID_KEY and
> then?__connman_service_needs_input would be called from
> __connman_service_connect.

Upstream does not have this?__connman_service_needs_input function, but
otherwise this is how it works.

> 6) User input new passphrase will be supplied and then service->error 
> would be cleared and connect would happen.

Yes.

> The key here is that application on top of connman should not be
> clearing the error property on invalid_key. If you clear that error,
> connman would just keep using the old keys.
> 
> Changing the favorite flag is not the right thing to do here.

Fully agree.

Cheers,

        Patrik



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 6, Issue 3
*************************************

Reply via email to