> 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
>>>
>>> ---
>>>  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
Hi Marcel,
indeed, please find a more readable patch suggestion

Best regards
Thierry

---
 plugins/ofono.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index 0c23462..b75a1fd 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -422,6 +422,7 @@ static void set_connected(struct network_info *info,
 
        switch (info->ipv4_method) {
        case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
+               goto ipv6;
        case CONNMAN_IPCONFIG_METHOD_OFF:
        case CONNMAN_IPCONFIG_METHOD_MANUAL:
        case CONNMAN_IPCONFIG_METHOD_AUTO:
@@ -442,6 +443,10 @@ static void set_connected(struct network_info *info,
                break;
        }
 
+       connman_network_set_connected(info->network, connected);
+       return;
+
+ipv6:
        switch (info->ipv6_method) {
        case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
        case CONNMAN_IPCONFIG_METHOD_OFF:
-- 
1.7.3



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

Reply via email to