WISPr authentication
by Thomas Green
I seem to not be understanding connman support for WISPr access points. I have an access point that (from my (android) phone) when I connect to it I'm prompted to sign in on what appears to be a web page. When I try with connmanctl, I get neither the RequestInput method with Username and Password prompts or a RequestBrowser with an url argument. If I'm watching dbus for messages I get no indication that these callbacks are being requested either. It says that I'm connected, but I can't ping anything. I've verified that connman was built with -enable-wispr. Connman version is 1.29.
What am I doing wrong?
Tom
connmanctl> agent on
Agent registered
connmanctl> services wifi_884aea637670_5075626c6963_managed_none
connmanctl>
/net/connman/service/wifi_884aea637670_5075626c6963_managed_none
Type = wifi
Security = [ none ]
State = idle
Strength = 66
Favorite = False
Immutable = False
AutoConnect = False
Name = Public
Ethernet = [ Method=auto, Interface=wlan0, Address=88:4A:EA:63:76:70, MTU=1500 ]
IPv4 = [ ]
IPv4.Configuration = [ Method=dhcp ]
IPv6 = [ ]
IPv6.Configuration = [ Method=auto, Privacy=disabled ]
Nameservers = [ ]
Nameservers.Configuration = [ ]
Timeservers = [ ]
Timeservers.Configuration = [ ]
Domains = [ ]
Domains.Configuration = [ ]
Proxy = [ ]
Proxy.Configuration = [ ]
Provider = [ ]
connmanctl> connect wifi_884aea637670_5075626c6963_managed_none
connmanctl>
Connected wifi_884aea637670_5075626c6963_managed_none
connmanctl> quit
3 years, 4 months
[[PATCH v3] 0/1] implements periodic online check
by Julien Massot
From: Julien Massot <jmassot(a)softbankrobotics.com>
Changes since v3:
* Address Daniel's comment in patch 2/2
* Remove warning log for online failure
* Use a define for the maximum timeout
* Previous patch 1/2 already accepted
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 (1):
service: retry online check permanently until success
src/service.c | 48 +++++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 23 deletions(-)
--
2.21.0
3 years, 5 months
Missing wifi service
by JH
Hi,
I am running connman in my Ubunut 18 laptop, the etnernet is under
control, the ethernet_c47d461dc1f1_cable is in /var/lib/connman. The
wifi is enabled, but there is no wifi service, only ethernet service.
How can I bring the wifi service running? I don't think I should
manually change things in /var/lib/connman. The only configure file I
can see is the /etc/connman/main.conf which does not have configure
for wifi or enthernet, where is the connman configuration?
$ connmanctl services
*AO Wired ethernet_c47d461dc1f1_cable
$ connmanctl technologies
/net/connman/technology/ethernet
Name = Wired
Type = ethernet
Powered = True
Connected = True
Tethering = False
/net/connman/technology/bluetooth
Name = Bluetooth
Type = bluetooth
Powered = False
Connected = False
Tethering = False
/net/connman/technology/wifi
Name = WiFi
Type = wifi
Powered = True
Connected = False
Tethering = False
Thank you.
- jh
3 years, 5 months
[PATCH] service: Handle NULL pointer in __connman_service_set_{domain|host}name
by Daniel Wagner
516af0fd1586 ("service: Sanitize input for hostname and domainname")
address the shutdown path:
connmand[12534]: ++++++++ backtrace ++++++++
connmand[12534]: #0 0x7fefba7195c0 in /lib64/libc.so.6
connmand[12534]: #1 0x7fefbab8caa4 in /lib64/libglib-2.0.so.0
connmand[12534]: #2 0x44c600 in __connman_service_set_domainname() at src/service.c:2664
connmand[12534]: #3 0x462d16 in apply_dhcp_invalidate_on_network() at src/dhcp.c:110
connmand[12534]: #4 0x463c87 in dhcp_free() at src/dhcp.c:70
connmand[12534]: #5 0x442bd8 in set_disconnected() at src/network.c:1009
connmand[12534]: #6 0x442e10 in network_remove() at src/network.c:1120
connmand[12534]: #7 0x442e77 in connman_network_driver_unregister() at src/network.c:1211
connmand[12534]: #8 0x41cf88 in ethernet_exit() at plugins/ethernet.c:462
connmand[12534]: #9 0x43f1d9 in __connman_plugin_cleanup() at src/plugin.c:202
connmand[12534]: #10 0x4113f4 in main() at src/main.c:874
connmand[12534]: #11 0x7fefba705413 in /lib64/libc.so.6
---
src/service.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/service.c b/src/service.c
index adc5deb4c82b..3202f26cc1cc 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2638,11 +2638,10 @@ void __connman_service_set_hostname(struct connman_service *service,
return;
g_free(service->hostname);
+ service->hostname = NULL;
- if (g_str_is_ascii(hostname))
+ if (hostname && g_str_is_ascii(hostname))
service->hostname = g_strdup(hostname);
- else
- service->hostname = NULL;
}
const char *__connman_service_get_hostname(struct connman_service *service)
@@ -2660,11 +2659,10 @@ void __connman_service_set_domainname(struct connman_service *service,
return;
g_free(service->domainname);
+ service->domainname = NULL;
- if (g_str_is_ascii(domainname))
+ if (domainname && g_str_is_ascii(domainname))
service->domainname = g_strdup(domainname);
- else
- service->domainname = NULL;
domain_changed(service);
}
--
2.20.1
3 years, 5 months
[PATCH] main: Fix typo in config option
by Daniel Wagner
The option is defined and documented as UseGatewaysAsTimeservers.
Reported-by chewitt.
---
src/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
index 2e2cc4bdb057..2371771f76a3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -135,7 +135,7 @@ static struct {
#define CONF_ENABLE_ONLINE_CHECK "EnableOnlineCheck"
#define CONF_AUTO_CONNECT_ROAMING_SERVICES "AutoConnectRoamingServices"
#define CONF_ACD "AddressConflictDetection"
-#define CONF_USE_GATEWAYS_AS_TIMESERVERS "UseGatewayAsTimeservers"
+#define CONF_USE_GATEWAYS_AS_TIMESERVERS "UseGatewaysAsTimeservers"
static const char *supported_options[] = {
CONF_BG_SCAN,
--
2.20.1
3 years, 5 months
[PATCH v3 0/4] Timeserver fixes
by Daniel Wagner
v2 revealed some more issues with the retry logic. This version is now
getting closer to a working time server selection code.
Happy testing!
Daniel Wagner (4):
ntp: Set timeout value
timeserver: Only start once timeserver search
ntp: Do not log errors if send request fails
timeserver: Refactor select next time server code
src/ntp.c | 19 +++---------
src/timeserver.c | 81 ++++++++++++++++++------------------------------
2 files changed, 35 insertions(+), 65 deletions(-)
--
2.20.1
3 years, 5 months
[PATCH v2 1/1] service: Sanitize input for hostname and domainname
by Henrik Persson
From f9980195edb7ffab18315b880cf0ff1fb026f3b7 Mon Sep 17 00:00:00 2001
From: Henrik Persson <henrik.persson(a)verisure.com>
Date: Mon, 18 Mar 2019 12:20:34 +0100
Subject: [PATCH v2 1/1] service: Sanitize input for hostname and domainname
If a DHCP ACK is received with non-UTF-8 data set as hostname or
domain-name option connman will crash on a D-Bus assert. This patch
sanitizes data in service.c and only allows ASCII characters (since
they shouldn't be anything else) for __connman_service_set_hostname()
and __connman_service_set_domainname().
Since the fix involves using g_str_is_ascii() we also need to bump
Glib dependency to 2.40 (which was released in March 2014).
---
configure.ac | 4 ++--
src/service.c | 12 ++++++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0bb2a6d9..a6e14b76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,8 +221,8 @@ fi
AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
- AC_MSG_ERROR(GLib >= 2.28 is required))
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.40, dummy=yes,
+ AC_MSG_ERROR(GLib >= 2.40 is required))
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
diff --git a/src/service.c b/src/service.c
index ea1905bf..7ae252ec 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2638,7 +2638,11 @@ void __connman_service_set_hostname(struct connman_service *service,
return;
g_free(service->hostname);
- service->hostname = g_strdup(hostname);
+
+ if (g_str_is_ascii(hostname))
+ service->hostname = g_strdup(hostname);
+ else
+ service->hostname = NULL;
}
const char *__connman_service_get_hostname(struct connman_service *service)
@@ -2656,7 +2660,11 @@ void __connman_service_set_domainname(struct connman_service *service,
return;
g_free(service->domainname);
- service->domainname = g_strdup(domainname);
+
+ if (g_str_is_ascii(domainname))
+ service->domainname = g_strdup(domainname);
+ else
+ service->domainname = NULL;
domain_changed(service);
}
--
2.17.1
3 years, 5 months
[PATCH 1/1] service: Sanitize hostname and domainname
by Henrik Persson
From: Henrik Persson <henrik.persson(a)verisure.com>
If a DHCP ACK is received with non-UTF-8 data set as hostname or
domain-name option connman will crash on a D-Bus assert. This patch
sanitizes data in service.c and only allows ASCII characters (since they
shouldn't be anything else) for __connman_service_set_hostname() and
__connman_service_set_domainname().
This scapy script will trigger the crash:
$ cat dhcp-poc.py
from scapy.all import DHCP_am
from scapy.base_classes import Net
dhcp_server = DHCP_am(iface='eth1', domain='\xff\xff\xff\xff',
pool=Net('192.168.10.0/24'),
network='192.168.10.0/24',
gw='192.168.10.254',
renewal_time=600, lease_time=3600)
dhcp_server()
producing a backtrace along the lines of (for 1.35, but have verified on
later versions as well):
#0 __libc_do_syscall () at
../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
#1 0x76c8b0a4 in __libc_signal_restore_set (set=0x7ea82c60) at
/usr/src/debug/glibc/2.26-r0/git/sysdeps/unix/sysv/linux/nptl-signals.h:80
#2 __GI_raise (sig=sig@entry=6) at
/usr/src/debug/glibc/2.26-r0/git/sysdeps/unix/sysv/linux/raise.c:48
#3 0x76c8bcce in __GI_abort () at
/usr/src/debug/glibc/2.26-r0/git/stdlib/abort.c:90
#4 0x76ed83d4 in _dbus_abort () at
/usr/src/debug/dbus/1.10.20-r0/dbus-1.10.20/dbus/dbus-sysdeps.c:91
#5 0x76ed270a in _dbus_warn_check_failed (
format=0x76ede0ac "arguments to %s() were incorrect, assertion
\"%s\" failed in file %s line %d.\nThis is normally a bug in some
application using the D-Bus library.\n")
at
/usr/src/debug/dbus/1.10.20-r0/dbus-1.10.20/dbus/dbus-internals.c:275
#6 0x76ec8636 in dbus_message_iter_append_basic (iter=<optimized out>,
type=115, value=0x1ee6d40) at
/usr/src/debug/dbus/1.10.20-r0/dbus-1.10.20/dbus/dbus-message.c:2753
#7 0x005274d4 in connman_dbus_property_append_array
(iter=iter@entry=0x7ea82fa4, key=<optimized out>, key@entry=0x54a8f8
"Domains", type=type@entry=115,
function=function@entry=0x50b2b5 <append_domain>,
user_data=user_data@entry=0x1ee6cd0) at
/usr/src/debug/connman/1.35-r0/connman-1.35/src/dbus.c:224
#8 0x00527654 in connman_dbus_property_changed_array (path=<optimized
out>, interface=<optimized out>, key=0x54a8f8 "Domains",
type=type@entry=115, function=0x50b2b5 <append_domain>,
user_data=user_data@entry=0x1ee6cd0) at
/usr/src/debug/connman/1.35-r0/connman-1.35/src/dbus.c:291
#9 0x0050b3de in domain_changed (service=0x1ee6cd0) at
/usr/src/debug/connman/1.35-r0/connman-1.35/src/service.c:2040
#10 0x0051f6c2 in apply_lease_available_on_network (dhcp=0x1ef7d40,
dhcp_client=0x1eeab80) at
/usr/src/debug/connman/1.35-r0/connman-1.35/src/dhcp.c:368
#11 lease_available_cb (dhcp_client=0x1eeab80, user_data=0x1ef7d40) at
/usr/src/debug/connman/1.35-r0/connman-1.35/src/dhcp.c:515
#12 0x004e9a24 in listener_event (channel=<optimized out>,
condition=<optimized out>, user_data=<optimized out>) at
/usr/src/debug/connman/1.35-r0/connman-1.35/gdhcp/client.c:2422
#13 0x76f29508 in g_main_dispatch (context=0x1ed4b90) at
/usr/src/debug/glib-2.0/1_2.52.3-r0/glib-2.52.3/glib/gmain.c:3234
#14 g_main_context_dispatch (context=context@entry=0x1ed4b90) at
/usr/src/debug/glib-2.0/1_2.52.3-r0/glib-2.52.3/glib/gmain.c:3899
#15 0x76f29798 in g_main_context_iterate (context=0x1ed4b90,
block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at /usr/src/debug/glib-2.0/1_2.52.3-r0/glib-2.52.3/glib/gmain.c:3972
#16 0x76f29a1a in g_main_loop_run (loop=0x1eba1e8) at
/usr/src/debug/glib-2.0/1_2.52.3-r0/glib-2.52.3/glib/gmain.c:4168
#17 0x004e7a90 in main (argc=<optimized out>, argv=<optimized out>) at
/usr/src/debug/connman/1.35-r0/connman-1.35/src/main.c:780
---
diff --git a/src/service.c b/src/service.c
index f6fe81bf..42b5449a 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2637,7 +2637,11 @@ void __connman_service_set_hostname(struct
connman_service *service,
return;
g_free(service->hostname);
- service->hostname = g_strdup(hostname);
+
+ if (g_str_is_ascii(hostname))
+ service->hostname = g_strdup(hostname);
+ else
+ service->hostname = NULL;
}
const char *__connman_service_get_hostname(struct connman_service
*service)
@@ -2655,7 +2659,11 @@ void __connman_service_set_domainname(struct
connman_service *service,
return;
g_free(service->domainname);
- service->domainname = g_strdup(domainname);
+
+ if (g_str_is_ascii(domainname))
+ service->domainname = g_strdup(domainname);
+ else
+ service->domainname = NULL;
domain_changed(service);
}
3 years, 5 months
[PATCH] Teach ConnMan to select the next BSSID when two APs with the same SSID and securcity configuration are available
by Rahul Jain
[PATCH] Teach ConnMan to select the next BSSID when two APs (e.g. 2.4
GHz and 5 GHz) with the same SSID and securcity configuration are available.
Currently when one AP disapears ConnMan will retry to connect to the
old AP point even though there is another matching BSSID available.
So when wpa_supplicant sends a remove signal we find a matching BSSID
and use it even when it's not from the same AP.
---
gsupplicant/supplicant.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index da8c52e..bfca281 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2206,6 +2206,7 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data)
GSupplicantNetwork *network;
struct g_supplicant_bss *bss = NULL;
const char *path = NULL;
+ bool is_current_network_bss = false;
dbus_message_iter_get_basic(iter, &path);
if (!path)
@@ -2219,6 +2220,7 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data)
if (network->best_bss == bss) {
network->best_bss = NULL;
network->signal = BSS_UNKNOWN_STRENGTH;
+ is_current_network_bss=true;
}
g_hash_table_remove(bss_mapping, path);
@@ -2230,6 +2232,10 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data)
if (g_hash_table_size(network->bss_table) == 0)
g_hash_table_remove(interface->network_table, network->group);
+ else {
+ if (is_current_network_bss && network->best_bss)
+ callback_network_changed(network, "");
+ }
}
static void set_config_methods(DBusMessageIter *iter, void *user_data)
--
2.7.4
3 years, 5 months
[PATCH] gsupplicant: Switch to different BSSID of same SSID in case of signal bss removed
by Rahul Jain
[PATCH] gsupplicant: Switch to different BSSID of same SSID in case of
signal bss removed
[Cause] 2 AP (same name & security) was used in testing, 2.4 Ghz and 5Ghz.
TV was connected with 2.4 Ghz AP. Now Tester switch off(soft) that
AP from router webpage.Now supplicant send bss_removed signal to
connman for that AP and tester switch on 5GHz AP from router page.
But within few time, supplicant again send bss_removed signal to
connman(as AP was switch of from router web page), so took few time
to go down. When connman get bss_added signal for 2.4 AP, then make
addNetwork connection request to supplicant, but that time, 2.4 AP
was already switched off.So supplicant keeps to trying to find that
AP. Meanwhile supplicant sent bss_added signal for 5Ghz AP as that
was switched on. Now in connman under same AP 2 BSSID is there. After
few retry & time (~10 milisecond) during connection retry with 2.4,
when supplicant did not found that 2.4 AP, then send bss_removed signal
to connman and connman remove that bSS from g_supplicant network hash
table. After 120 sec connman connect_timeout hit and connection with
2.4 AP disconnected. Now connman again try connection with 2.4 AP and
send addNetwork for 2.4 though supplicant send bss_removed. This is an
issue, whereas connman should try connection with 5ghz there.
[Solution]
After few retry & time (~10 milisecond) during connection retry with
2.4, when supplicant did not found that 2.4 AP, then supplicant
send bss_removed signal to connman and connman remove that bSS from
g_supplicant network hash table and should update next available BSS
i.e. 5Ghz as best_bss and notify wifi.c:network_change, so that
same will be upated in connman_network.
So when next request for addNetwork will go to supplicant that will be for
5Ghz.
---
gsupplicant/supplicant.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index da8c52e..623e424 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2206,6 +2206,7 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data)
GSupplicantNetwork *network;
struct g_supplicant_bss *bss = NULL;
const char *path = NULL;
+ bool isCurrentNetworkBss=false;
dbus_message_iter_get_basic(iter, &path);
if (!path)
@@ -2219,6 +2220,7 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data)
if (network->best_bss == bss) {
network->best_bss = NULL;
network->signal = BSS_UNKNOWN_STRENGTH;
+ isCurrentNetworkBss=true;
}
g_hash_table_remove(bss_mapping, path);
@@ -2230,6 +2232,10 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data)
if (g_hash_table_size(network->bss_table) == 0)
g_hash_table_remove(interface->network_table, network->group);
+ else {
+ if(isCurrentNetworkBss && network->best_bss)
+ callback_network_changed(network, "");
+ }
}
static void set_config_methods(DBusMessageIter *iter, void *user_data)
--
2.7.4
3 years, 5 months