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: Error "wifi: No carrier" only to connman (Jun Nie)
2. Re: Error "wifi: No carrier" only to connman (Daniel Wagner)
3. Re: [PATCH 1/2] service: track g_timeout for wispr try
(Julien Massot)
4. [PATCH v2 1/2] service: track g_timeout for wispr try
(Julien Massot)
5. [PATCH v2 0/2] implements periodic online check (Julien Massot)
6. [PATCH v2 2/2] service: retry online check permanently until
success (Julien Massot)
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 Mar 2019 16:25:00 +0800
From: Jun Nie <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: connman <[email protected]>
Subject: Re: Error "wifi: No carrier" only to connman
Message-ID:
<CABymUCPkW7ANsCMQZ1n7Rgc=kxkvkrxhj3jcwbvgcapk+4g...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Daniel Wagner <[email protected]> ?2019?3?12??? ??7:18???
>
> > For "tcpdump -i nlmon -w trace-file.pcap", the trace file size
> > increase for "connmanctl enable/disable wifi", but
> > does not increase for "connmanctl scan wifi" command. Can we confirm
> > connman does not send out any
> > message to network layer for scan command?
>
> Scanning is a difficult topic with wpa_supplicant. Generally speaking,
> wpa_supplicant should do the job. But the behavior depends heavily on
> the hardware/driver and wpa_supplicant. Normally, you should see the
> D-Bus message from ConnMan to wpa_supplicant if you do a 'connmanctlscan
> wifi'
For dbus message, I did not collect any log yet due to connection
issue. I am not sure why DBUS_SESSION_BUS_ADDRESS cannot be found on
board as on PC. Do you have any suggestion to collect dbus message?
root@mbed-linux-os-1871:~# DBUS_ADDRESS=$(grep
DBUS_SESSION_BUS_ADDRESS /proc/$(pidof wpa_supplicant)/environ)
root@mbed-linux-os-1871:~#
root@mbed-linux-os-1871:~# dbus-monitor --address "$DBUS_ADDRESS"
"type=signal,interface=fi.w1.wpa_supplicant1"
Failed to open connection to : Empty address ''
>
> > BTW: do you know how to read trace file? "iwmon -r trace-file.pcap"
> > does not emit any info.
>
> What API is wpa_supplicant using for stearing the driver? WEXT or
> nlm8011? WEXT is not supported.
I am not sure which driver is default one. But I killed wpa_supplicant
and run below two commands in different test, and see bug in both
case. Is this the right test?
wpa_supplicant -D nl80211 -u -t -ddd 2>&1 > /tmp/wpa.log &
wpa_supplicant -D wext -u -t -ddd 2>&1 > /tmp/wpa.log &
Jun
------------------------------
Message: 2
Date: Wed, 13 Mar 2019 09:27:55 +0100
From: Daniel Wagner <[email protected]>
To: Jun Nie <[email protected]>
Cc: connman <[email protected]>
Subject: Re: Error "wifi: No carrier" only to connman
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
> For dbus message, I did not collect any log yet due to connection
> issue. I am not sure why DBUS_SESSION_BUS_ADDRESS cannot be found on
> board as on PC. Do you have any suggestion to collect dbus message?
I think wpa_s prints also message when running with -ddd that a scan has
been trigger. So you don't have to intercept the D-Bus message if that
is a prroblem in your setup.
> I am not sure which driver is default one. But I killed wpa_supplicant
> and run below two commands in different test, and see bug in both
> case. Is this the right test?
Also no idea what the default is but my bet would be on wext :)
> wpa_supplicant -D nl80211 -u -t -ddd 2>&1 > /tmp/wpa.log &
> wpa_supplicant -D wext -u -t -ddd 2>&1 > /tmp/wpa.log &
That looks about right.
------------------------------
Message: 3
Date: Wed, 13 Mar 2019 09:29:56 +0100
From: Julien Massot <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/2] service: track g_timeout for wispr try
Message-ID:
<cahuus6fjm3mmwnkrxqiy15_p2f81nk90jjb5moyg6c-ayda...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
>
> Do an early return:
>
> if (service->online_timeout == 0)
> return;
>
Ok
> ....
>
> > +
> > int __connman_service_disconnect(struct connman_service *service)
> > {
> > int err;
> > @@ -6494,6 +6500,8 @@ int __connman_service_disconnect(struct
> > connman_service *service)
> >
> > __connman_stats_service_unregister(service);
> >
> > + cancel_online_check(service);
>
> Hmm, not sure if this the right place to cancel. Especially when you
> need to add the following cancel.
>
> > +
> > if (service->network) {
> > err = __connman_network_disconnect(service->network);
> > } else if (service->type == CONNMAN_SERVICE_TYPE_VPN &&
> > @@ -7280,6 +7288,7 @@ void __connman_service_remove_from_network(struct
> > connman_network *network)
> > __connman_connection_gateway_remove(service,
> > CONNMAN_IPCONFIG_TYPE_ALL);
> >
> > + cancel_online_check(service);
> > connman_service_unref(service);
> > }
>
> The state machine changes happen in
> __connman_service_ipconfig_indicate_state(). I think this call should be
> placed there once.
I will address these comment in a v2.
Thanks for the review
Julien
------------------------------
Message: 4
Date: Wed, 13 Mar 2019 09:38:15 +0100
From: Julien Massot <[email protected]>
To: [email protected]
Subject: [PATCH v2 1/2] service: track g_timeout for wispr try
Message-ID: <[email protected]>
From: Julien Massot <[email protected]>
In case we are disconnecting or removing the device,
the service will keep a ref until the timeout is reached.
Better to cancel the timeout, so that we can drop the ref,
and remove the service immediatly.
---
src/service.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/service.c b/src/service.c
index 43233671..dbdaaa14 100644
--- a/src/service.c
+++ b/src/service.c
@@ -127,6 +127,7 @@ struct connman_service {
char *pac;
bool wps;
bool wps_advertizing;
+ guint online_timeout;
int online_check_count_ipv4;
int online_check_count_ipv6;
bool do_split_routing;
@@ -5998,13 +5999,8 @@ static void service_rp_filter(struct connman_service
*service,
static void redo_wispr(struct connman_service *service,
enum connman_ipconfig_type type)
{
- int refcount = service->refcount - 1;
-
+ service->online_timeout = 0;
connman_service_unref(service);
- if (refcount == 0) {
- DBG("Service %p already removed", service);
- return;
- }
DBG("Retrying %s WISPr for %p %s",
__connman_ipconfig_type2string(type),
@@ -6062,11 +6058,22 @@ int __connman_service_online_check_failed(struct
connman_service *service,
* necessary IPv6 router advertisement messages that might have
* DNS data etc.
*/
- g_timeout_add_seconds(1, redo_func, connman_service_ref(service));
+ service->online_timeout = g_timeout_add_seconds(1, redo_func,
+ connman_service_ref(service));
return EAGAIN;
}
+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;
+}
+
int __connman_service_ipconfig_indicate_state(struct connman_service *service,
enum connman_service_state new_state,
enum connman_ipconfig_type type)
@@ -6167,8 +6174,10 @@ int __connman_service_ipconfig_indicate_state(struct
connman_service *service,
break;
}
- if (is_connected(old_state) && !is_connected(new_state))
+ if (is_connected(old_state) && !is_connected(new_state)) {
nameserver_remove_all(service, type);
+ cancel_online_check(service);
+ }
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
service->state_ipv4 = new_state;
--
2.20.1
------------------------------
Message: 5
Date: Wed, 13 Mar 2019 09:38:14 +0100
From: Julien Massot <[email protected]>
To: [email protected]
Subject: [PATCH v2 0/2] implements periodic online check
Message-ID: <[email protected]>
From: Julien Massot <[email protected]>
Changes since v2:
* Address Daniel's comment in patch 1/2
* drop the linear backoff to something more incremental
* inspired by Sailfish OS.
This patch set implements a periodic retry on online check.
That's something I have in my ConnMan tree for years, and may
have interrest to land mainline.
So if we fail our online check just after ready state, we will retry
periodically.
Once the online check succeed we stop probing the network.
That should be interresting for software which wait for internet connection
on boot.
I didn't test the ipv6 case so I will be happy if someone can give it a try.
Online checking is still not perfect since Internet connection may drop, after
a successful online check happen.
Julien Massot (2):
service: track g_timeout for wispr try
service: retry online check permanently until success
src/service.c | 63 +++++++++++++++++++++++++++++++--------------------
1 file changed, 39 insertions(+), 24 deletions(-)
--
2.20.1
------------------------------
Message: 6
Date: Wed, 13 Mar 2019 09:38:16 +0100
From: Julien Massot <[email protected]>
To: [email protected]
Subject: [PATCH v2 2/2] service: retry online check permanently until
success
Message-ID: <[email protected]>
From: Julien Massot <[email protected]>
This make online check happen right after ready state, and
then after ONLINE_CHECK_INITIAL_INTERVAL (1 second) like before,
then online check happen to interval * interval which is incremented
until 12, which result in a maximum timeout of 144s.
Once we reached the ready state we stop online check.
---
src/service.c | 42 ++++++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 18 deletions(-)
diff --git a/src/service.c b/src/service.c
index dbdaaa14..e73c02f0 100644
--- a/src/service.c
+++ b/src/service.c
@@ -128,8 +128,8 @@ struct connman_service {
bool wps;
bool wps_advertizing;
guint online_timeout;
- int online_check_count_ipv4;
- int online_check_count_ipv6;
+ int online_check_interval_ipv4;
+ int online_check_interval_ipv6;
bool do_split_routing;
bool new_service;
bool hidden_service;
@@ -3426,15 +3426,22 @@ int __connman_service_reset_ipconfig(struct
connman_service *service,
return err;
}
+/*
+ * 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.
+ */
+#define ONLINE_CHECK_INITIAL_INTERVAL 1
+
void __connman_service_wispr_start(struct connman_service *service,
enum connman_ipconfig_type type)
{
DBG("service %p type %s", service,
__connman_ipconfig_type2string(type));
if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
- service->online_check_count_ipv4 = 1;
+ service->online_check_interval_ipv4 =
ONLINE_CHECK_INITIAL_INTERVAL;
else
- service->online_check_count_ipv6 = 1;
+ service->online_check_interval_ipv6 =
ONLINE_CHECK_INITIAL_INTERVAL;
__connman_wispr_start(service, type);
}
@@ -6031,35 +6038,34 @@ int __connman_service_online_check_failed(struct
connman_service *service,
enum connman_ipconfig_type type)
{
GSourceFunc redo_func;
- int *count;
+ int *interval;
if (type == CONNMAN_IPCONFIG_TYPE_IPV4) {
- count = &service->online_check_count_ipv4;
+ interval = &service->online_check_interval_ipv4;
redo_func = redo_wispr_ipv4;
} else {
- count = &service->online_check_count_ipv6;
+ interval = &service->online_check_interval_ipv6;
redo_func = redo_wispr_ipv6;
}
- DBG("service %p type %s count %d", service,
- __connman_ipconfig_type2string(type), *count);
+ DBG("service %p type %s interval %d", service,
+ __connman_ipconfig_type2string(type), *interval);
- if (*count == 0) {
+ if (*interval == ONLINE_CHECK_INITIAL_INTERVAL) {
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.
*/
- service->online_timeout = g_timeout_add_seconds(1, redo_func,
- connman_service_ref(service));
+ (*interval)++;
+ if (*interval > 12)
+ *interval = 12;
return EAGAIN;
}
--
2.20.1
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 41, Issue 14
***************************************