Disable online check for real
cover Disable online check for real
Страхиња reported we still do some online checks even though EnableOnlineCheck is set to false. Let's move the __connman_service_wispr_start() code to helper and add a check there.
Daniel Wagner (2):
service: Move wispr start code into helper
service: Do not trigger wispr start when EnableOnlineCheck is disabled
src/service.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/2 service: Move wispr start code into helper
We want to be able to extend the functionally around the __connman_service_wispr_start() code. Instead having to update the open code part for IPv4 and IPv6 handling, let's move into a small helper.
--- src/service.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-)
src/service.c +15 -16
@@ -1595,6 +1595,19 @@ bool __connman_service_index_is_default(int index)return __connman_service_get_index (service) == index; } +static void start_wispr_when_connected (struct connman_service *service) +{ +if (__connman_service_is_connected_state (service, +CONNMAN_IPCONFIG_TYPE_IPV4 )) +__connman_service_wispr_start (service, +CONNMAN_IPCONFIG_TYPE_IPV4 ); + +if (__connman_service_is_connected_state (service, +CONNMAN_IPCONFIG_TYPE_IPV6 )) +__connman_service_wispr_start (service, +CONNMAN_IPCONFIG_TYPE_IPV6 ); +} +static void default_changed (void ) {struct connman_service *service =connman_service_get_default ();
@@ -1619,15 +1632,7 @@ static void default_changed(void) connman_setting_get_bool("AllowDomainnameUpdates"))__connman_utsname_set_domainname (service->domainname); -if (__connman_service_is_connected_state (service, -CONNMAN_IPCONFIG_TYPE_IPV4 )) -__connman_service_wispr_start (service, -CONNMAN_IPCONFIG_TYPE_IPV4 ); - -if (__connman_service_is_connected_state (service, -CONNMAN_IPCONFIG_TYPE_IPV6 )) -__connman_service_wispr_start (service, -CONNMAN_IPCONFIG_TYPE_IPV6 ); +start_wispr_when_connected (service);/* * Connect VPN automatically when new default service
@@ -3726,13 +3731,7 @@ static DBusMessage *set_property(DBusConnection *conn,nameserver_add_all (service,CONNMAN_IPCONFIG_TYPE_ALL );dns_configuration_changed (service); -if (__connman_service_is_connected_state (service, -CONNMAN_IPCONFIG_TYPE_IPV4 )) -__connman_service_wispr_start (service,CONNMAN_IPCONFIG_TYPE_IPV4 ); - -if (__connman_service_is_connected_state (service, -CONNMAN_IPCONFIG_TYPE_IPV6 )) -__connman_service_wispr_start (service,CONNMAN_IPCONFIG_TYPE_IPV6 ); +start_wispr_when_connected (service);service_save (service); }else if (g_str_equal (name,"Timeservers.Configuration" )) {
Signature · 1 line
2.32.0
PATCH 2/2 service: Do not trigger wispr start when EnableOnlineCheck is disabled
In reply to Daniel WagnerDo not try to use wispr when the user has disabled the online check.
Reported by Страхиња Радић
--- src/service.c | 6 ++++++ 1 file changed, 6 insertions(+)
src/service.c +6 -0
@@ -1597,6 +1597,12 @@ bool __connman_service_index_is_default(int index)static void start_wispr_when_connected (struct connman_service *service) { +if (!connman_setting_get_bool ("EnableOnlineCheck" )) { +connman_info ("Online check disabled. " +"Default service remains in READY state." ); +return ; + } +if (__connman_service_is_connected_state (service,CONNMAN_IPCONFIG_TYPE_IPV4 )) __connman_service_wispr_start(service,
Signature · 1 line
2.32.0
Re: [PATCH v1 2/2] service: Do not trigger wispr start when EnableOnlineCheck is disabled
Quoted 1 line · Daniel Wagner
Do not try to use wispr when the user has disabled the online check.
The patch you proposed seems fine to me. The gist is to let the user control if the online check happens or not.
Re: [PATCH v1 2/2] service: Do not trigger wispr start when EnableOnlineCheck is disabled
Quoted 5 lines · Страхиња Радић
Quoted 1 line · Daniel Wagner
Do not try to use wispr when the user has disabled the online check.
The patch you proposed seems fine to me. The gist is to let the user control if the online check happens or not.
Could you give them a quick test if they work for you? Thanks!
Re: [PATCH v1 2/2] service: Do not trigger wispr start when EnableOnlineCheck is disabled
Quoted 8 lines · Daniel Wagner
Quoted 5 lines · Страхиња Радић
Quoted 1 line · Daniel Wagner
Do not try to use wispr when the user has disabled the online check.
The patch you proposed seems fine to me. The gist is to let the user control if the online check happens or not.
Could you give them a quick test if they work for you? Thanks!
I tested the patch with tcpdump, but unfortunately, it seems the connections are still being made, even with EnableOnlineCheck=false, Enable6to4=false and EnableOnlineToReadyTransition=false in /etc/connman/main.conf.
I first uninstalled and pkilled any existing versions of connman, then ensured I applied both of your patches with git apply, ran make clean && make and make install as root. Then I ran connmand as root and inside connmanctl:
connmanctl> enable wifi
connmanctl> agent on
connmanctl> connect <my_network>
<entered passphrase>
at the same time, I used tcpdump -i wlan0 > log.txt
and in the log I got a number of lines containing ipv4.connman.net.
Then I tried to apply my patch on top of your patches and repeat the process, but got the same result.
Re: [PATCH v1 2/2] service: Do not trigger wispr start when EnableOnlineCheck is disabled
Quoted 3 lines · Страхиња Радић
I tested the patch with tcpdump, but unfortunately, it seems the connections are still being made, even with EnableOnlineCheck=false, Enable6to4=false and EnableOnlineToReadyTransition=false in
/etc/connman/main.conf.
I found the culprit -- when built from source, default prefix is /usr/local, so connman was looking for main.conf in /usr/local/etc/connman instead of /etc/connman. When I symlinked /etc/connman/main.conf to /usr/local/etc/connman/main.conf and repeated the test, there were no occurrences of ipv4.connman.net in the log. I also repeated the test using only your two patches, without my patch, and got the same result.
Your two patches combined look ok.
Re: [PATCH v1 2/2] service: Do not trigger wispr start when EnableOnlineCheck is disabled
Quoted 5 lines · Страхиња Радић
Quoted 3 lines · Страхиња Радић
I tested the patch with tcpdump, but unfortunately, it seems the connections are still being made, even with EnableOnlineCheck=false, Enable6to4=false and EnableOnlineToReadyTransition=false in
/etc/connman/main.conf.
Quoted 8 lines
I found the culprit -- when built from source, default prefix is
/usr/local, so connman was looking for main.conf in/usr/local/etc/connmaninstead of/etc/connman. When I symlinked/etc/connman/main.confto/usr/local/etc/connman/main.confand repeated the test, there were no occurrences of ipv4.connman.net in the log. I also repeated the test using only your two patches, without my patch, and got the same result.Your two patches combined look ok.
Perfect! Thanks for the testing. In this case I'll queue them up this evening.
Daniel
Quoted 5 lines · Daniel Wagner
Страхиња reported we still do some online checks even though EnableOnlineCheck is set to false. Let's move the
__connman_service_wispr_start()code to helper and add a check there.Cc Страхиња Радић <[email protected]>
Patches applied.