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 v2 1/2] service: track g_timeout for wispr try
      (Daniel Wagner)
   2. Re: [PATCH v2 2/2] service: retry online check permanently
      until success (Daniel Wagner)
   3. Re: [PATCH] connman.service.in: add CAP_SYS_ADMIN for
      setdomainname (Daniel Wagner)
   4. Re: [PATCH v2 1/2] service: track g_timeout for wispr try
      (Julien Massot)
   5. Re: disconnect_code == 1 from wpa_s results in wrong state in
      wifi tech (Henrik Persson)


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

Message: 1
Date: Thu, 14 Mar 2019 08:16:49 +0100
From: Daniel Wagner <[email protected]>
To: Julien Massot <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2 1/2] service: track g_timeout for wispr try
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi Julien,

> +static void cancel_online_check(struct connman_service *service)
> +{
> +     if (service->online_timeout == 0)
> +             return;
> +
> +     connman_service_unref(service);
> +     g_source_remove(service->online_timeout);
> +     service->online_timeout = 0;
> +}
> +

I've applied this patch. I just reoreded the above sequence because I
am paranoid. If the refcount is donw to 1 we would work on freed
memory. Maybe this never happens, who knows :)

Thanks,
Daniel


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

Message: 2
Date: Thu, 14 Mar 2019 08:24:11 +0100
From: Daniel Wagner <[email protected]>
To: Julien Massot <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2 2/2] service: retry online check permanently
        until success
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi Julien,

> -     if (*count == 0) {
> +     if (*interval == ONLINE_CHECK_INITIAL_INTERVAL) {

Previously we knew it failed because we tried until the counter was
down to 0. Now we start with the interval value 1. That means you get
a warning the first time and then never again. 

>               connman_warn("%s online check failed for %p %s",
>                       __connman_ipconfig_type2string(type),
>                       service, service->name);
> -             return 0;
>       }
>  
> -     *count -= 1;
> +     service->online_timeout = g_timeout_add_seconds(*interval * *interval,
> +                             redo_func, connman_service_ref(service));
>  
> -     /*
> -      * We set the timeout to 1 sec so that we have a chance to get
> -      * necessary IPv6 router advertisement messages that might have
> -      * DNS data etc.
> +     /* Increment the interval for the next time, set a maximum timeout of
> +      * 12 * 12 seconds.
>        */

Could you make a define instead of the 12 seconds hard coding? Then
you could use it above for the warning like

if ( *interval == MAX_INTERVAL * MAX_INTERVAL )

> -     service->online_timeout = g_timeout_add_seconds(1, redo_func,
> -                                     connman_service_ref(service));
> +     (*interval)++;
> +     if (*interval > 12)
> +             *interval = 12;
>

        if (*interval < MAX_INTERVAL)
                (*interval)++;

?

Thanks,
Daniel


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

Message: 3
Date: Thu, 14 Mar 2019 08:27:27 +0100
From: Daniel Wagner <[email protected]>
To: Julien Massot <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] connman.service.in: add CAP_SYS_ADMIN for
        setdomainname
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi Julien,

On Fri, Feb 01, 2019 at 10:57:22AM +0100, Julien Massot wrote:
> From: Julien Massot <[email protected]>
> 
> connman fail to set the domain name using setdomainname on
> systemd based system.
> 
> The reason is that setdmainname requires CAP_SYS_ADMIN

Patch applied.

Well, with CAP_SYS_ADMIN ConnMan is back having all the root rights.

Thanks,
Daniel


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

Message: 4
Date: Thu, 14 Mar 2019 10:20:16 +0100
From: Julien Massot <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2 1/2] service: track g_timeout for wispr try
Message-ID:
        <cahuus6h6xar5eafc6uamuwip5vzvapppn7u3fbkcf45ya_n...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hi Daniel,
> > +static void cancel_online_check(struct connman_service *service)
> > +{
> > +     if (service->online_timeout == 0)
> > +             return;
> > +
> > +     connman_service_unref(service);
> > +     g_source_remove(service->online_timeout);
> > +     service->online_timeout = 0;
> > +}
> > +
>
> I've applied this patch. I just reoreded the above sequence because I
> am paranoid. If the refcount is donw to 1 we would work on freed
> memory. Maybe this never happens, who knows :)
Good catch, thanks.

Julien


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

Message: 5
Date: Thu, 14 Mar 2019 10:11:17 +0000
From: Henrik Persson <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: disconnect_code == 1 from wpa_s results in wrong state in
        wifi tech
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

On 2019-03-11 17:37, Henrik Persson wrote:
> On 2019-03-10 19:39, Daniel Wagner wrote:
>>> In wifi.c:interface_state() line 2546 or so it says that we assume
>>> that reason 1 is because we are blocked. We also seem to assume that
>>> this is thrown when we are connecting, so we call
>>> connman_network_set_error(network,
>>> CONNMAN_NETWORK_ERROR_BLOCKED). This trickles down into
>>> service.c:service_indicate_state() line 5795 or so where
>>> connman_agent_report_error() is called. In my case I do have an
>>> agent registered, so that call will return -EINPROGRESS which will
>>> make service_indicate_state() to return then and there, calling SOME
>>> of the functions below on completion, but not
>>>    __connman_notifier_disconnect(), which would ultimately have
>>> triggered the technology change to connected=false.
>>
>>
>> Okay, so we leave service_indicate_state() to early and get the state
>> machine into inconsistent state. I digged a bit through the history
>> and I didn't find any good explanation why we return early.
>>
>> I suppose we should do something like (completly untested):
> [...]
>> connman_agent_report_error() will do a log entry if something goes
>> wrong. So we don't have to log it here. So could silenty go ahead and
>> update the state machine.
> 
> The patch applied, I'll test it and see if it improves things. That
> disconnect reason doesn't happen very often though, so might take a
> while.. It doesn't seem to break anything in the happy-flow-case so
> that's a good start. :)

I've attached a log of when I forced reason=1 to disconnect, and 
verified that technology/wifi/ seems to have switched state properly and 
from the looks of everything in the log everything else seems to work as 
it should (agent gets notified about error, etc). So I think that patch 
would be nice to have on HEAD. :)

Thanks!

--
Henrik Persson
Verisure Innovation AB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: force_disconnect_technology_change_test.log
Type: text/x-log
Size: 13405 bytes
Desc: force_disconnect_technology_change_test.log
URL: 
<http://lists.01.org/pipermail/connman/attachments/20190314/20918cd6/attachment.log>

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

Subject: Digest Footer

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


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

End of connman Digest, Vol 41, Issue 16
***************************************

Reply via email to