Hi,

On Thu, 2012-12-13 at 11:25 +0800, Arron Wang wrote:
> some device want to support wifi open tethering network type
> our ConnMan already supported, just not export the API, I also
> not sure whether we force the user to use encrypied wifi network
> for security consideration

If the passphrase is defined, WPA encryption is enabled. If it's
missing, an open WiFi network is created.

> ---
>  src/technology.c      |   18 +++++++++++++-----
>  test/enable-tethering |    7 +++++--
>  2 files changed, 18 insertions(+), 7 deletions(-)
> 
> diff --git a/src/technology.c b/src/technology.c
> index bf82b8d..d4382b8 100644
> --- a/src/technology.c
> +++ b/src/technology.c
> @@ -216,9 +216,6 @@ static int set_tethering(struct connman_technology 
> *technology,
>  {
>       const char *ident, *passphrase, *bridge;
>  
> -     ident = technology->tethering_ident;
> -     passphrase = technology->tethering_passphrase;
> -
>       if (technology->driver == NULL ||
>                       technology->driver->set_tethering == NULL)
>               return -EOPNOTSUPP;
> @@ -227,12 +224,23 @@ static int set_tethering(struct connman_technology 
> *technology,
>       if (technology->enabled == FALSE)
>               return -EACCES;
>  
> +     /* Clear passphrase filed when disable wifi tethering,
> +      * else if we once enabled encrypied wifi network,
> +      * we may failed to enable open wifi network type
> +      */
> +     if (enabled == FALSE) {
> +             g_free(technology->tethering_passphrase);
> +             technology->tethering_passphrase = NULL;
> +     }
> +
> +     ident = technology->tethering_ident;
> +     passphrase = technology->tethering_passphrase;
> +

We don't want to clear the passphrase when disconnecting since that'd
mean explicitely selecting open/WPA secured WiFi from some UI every time
tethering is enabled.

Thus NACK for this patch.


        Patrik


_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to