Hi Thierry,

> I've noticed "connman_network_set_connected" is called at the end of 
> "set_connected" function,
> however if method is ipv4, ipv6 is let to "unknown" and a "return" is done 
> before calling the function 
> which does the "ipconfig" of gsm IP address. 
> Please find the correction I suggest as first approach:
> 
> regards
> Thierry
> 
> 
> From 92332cf29bc10372f915d687cfc95eb64789a6a9 Mon Sep 17 00:00:00 2001
> From: Thierry Boureille <[email protected]>
> Date: Tue, 28 Jun 2011 13:35:13 +0200
> Subject: [PATCH] oFono : Fix connection which can't be called in ipv4
> 
> ---
>  plugins/ofono.c |   68 ++++++++++++++++++++++++++++++------------------------
>  1 files changed, 38 insertions(+), 30 deletions(-)
> 
> diff --git a/plugins/ofono.c b/plugins/ofono.c
> index 0c23462..3152b24 100644
> --- a/plugins/ofono.c
> +++ b/plugins/ofono.c
> @@ -419,44 +419,52 @@ static void set_connected(struct network_info *info,
>                               connman_bool_t connected)
>  {
>       DBG("network %p connected %d", info->network, connected);
> +     if (info->ipv4_method != CONNMAN_IPCONFIG_METHOD_UNKNOWN) {
>  
> -     switch (info->ipv4_method) {
> -     case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
> -     case CONNMAN_IPCONFIG_METHOD_OFF:
> -     case CONNMAN_IPCONFIG_METHOD_MANUAL:
> -     case CONNMAN_IPCONFIG_METHOD_AUTO:
> -             return;
> +             switch (info->ipv4_method) {
> +             case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
> +             case CONNMAN_IPCONFIG_METHOD_OFF:
> +             case CONNMAN_IPCONFIG_METHOD_MANUAL:
> +             case CONNMAN_IPCONFIG_METHOD_AUTO:
> +                     return;

I do not like this change at all. This makes the code fully unreadable.

So if I read the only a little bit right, then this should be done more
to effect of this:

        switch (info->ipv4_method) {
        case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
                goto ipv6;
        case CONNMAN_IPCONFIG_METHOD_OFF:
        ...
                return;
        ...

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to