[PATCH] Force BSS expiration
by Yasser
We were having a problem with our wifi scanning, where the list of
wifi available would become empty and would not be repopulated until
after a long delay. Researching the problem it seemed that it was
related to BSS expiration age. There were already some people who had
faced the same issue, so inspired by this we developed the following
patch which allows us to set the BSS expiration age to match ConnMan
long scanning interval to avoid the loss of networks during a long
interval between two scans.
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index bfb52db..08d6b9e 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -267,7 +267,8 @@ int
g_supplicant_interface_connect(GSupplicantInterface *interface,
int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
GSupplicantInterfaceCallback callback,
void *user_data);
-
+int g_supplicant_interface_set_bss_expiration_age(GSupplicantInterface
*interface,
+ unsigned int
bss_expiration_age);
int g_supplicant_interface_set_apscan(GSupplicantInterface *interface,
unsigned int ap_scan);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 6052f7b..fe6ad48 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -981,6 +981,46 @@ static void interface_capability(const char *key,
DBusMessageIter *iter,
key, dbus_message_iter_get_arg_type(iter));
}
+struct g_supplicant_bss_expiration_age
+{
+ GSupplicantInterface *interface;
+ unsigned int bss_expiration_age;
+};
+
+static void set_bss_expiration_age(DBusMessageIter *iter, void *user_data)
+{
+ struct g_supplicant_bss_expiration_age *data = user_data;
+ unsigned int bss_expiration_age = data->bss_expiration_age;
+
+ dbus_free(data);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32,
&bss_expiration_age);
+}
+
+int g_supplicant_interface_set_bss_expiration_age(GSupplicantInterface
*interface,
+ unsigned int
bss_expiration_age)
+{
+ struct g_supplicant_bss_expiration_age *data;
+ int ret;
+
+ data = dbus_malloc0(sizeof(*data));
+
+ if (!data)
+ return -ENOMEM;
+
+ data->bss_expiration_age = bss_expiration_age;
+ data->interface = interface;
+
+ ret = supplicant_dbus_property_set(interface->path,
+ SUPPLICANT_INTERFACE ".Interface",
+ "BSSExpireAge", DBUS_TYPE_UINT32_AS_STRING,
+ set_bss_expiration_age, NULL, data, NULL);
+ if (ret < 0)
+ dbus_free(data);
+
+ return ret;
+}
+
+
struct set_apscan_data
{
unsigned int ap_scan;
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 910b739..57b63e2 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1522,6 +1522,7 @@ static void interface_create_callback(int result,
void *user_data)
{
struct wifi_data *wifi = user_data;
+ char * bgscan_range_max;
DBG("result %d ifname %s, wifi %p", result,
g_supplicant_interface_get_ifname(interface),
@@ -1537,6 +1538,13 @@ static void interface_create_callback(int result,
wifi->interface_ready = true;
finalize_interface_creation(wifi);
}
+ /* Force the BSS expiration age to match ConnMan long scanning
interval to avoid the loss of networks during a long interval between
two scannings. */
+ if ((bgscan_range_max = strrchr(BGSCAN_DEFAULT,':')) != NULL &&
+
g_supplicant_interface_set_bss_expiration_age(interface,
strtol(bgscan_range_max + 1, (char**)NULL, 10) + 10) >= 0) {
+ DBG("bss expiration age successfully updated");
+ } else {
+ DBG("bss expiration age update has failed");
+ }
}
static int wifi_enable(struct connman_device *device)
2 months, 1 week
Re: Wifi Tethering
by Daniel Wagner
On Sat, Apr 25, 2020 at 11:20:45AM -0500, KeithG wrote:
> I looked at the IWD readme and cannot enable this on the RPi:
>
> # ip link set dev nlmon allmulticast on
> > Cannot find device "nlmon"
The RPi kernel has no support for nlmon enabled. If you want to debug this you
propably need to compile your own RPi kernel with nlmon enabled.
> I did verify a couple things. I do have iwd set explicitly when I start
> connman
> /usr/bin/connmand --wifi=iwd_agent -n --nodnsproxy
--wifi=iwd_agent is wrong. If you want iwd support you need to define this
at compile time only:
./configure --enable-iwd --disable-wifi
which adds the iwd plugin and disables the wpa_supplicant plugin. But I don't
think it matter. --iwfi-iwd_agent will be ignored and ConnMan will dynamically
discover iwd. Just make sure wpa_supplicant is not running. With the above
command line you would make sure wpa_supplicant is not accidentally used.
> When I issue the command from connman, the mode changes in iwd:
>
> > # connmanctl tether wifi on myssid password
> > Wifi SSID set
> > Wifi passphrase set
> > Enabled tethering for wifi
> > # ip addr
> > 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
> > default qlen 1000
> > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> > inet 127.0.0.1/8 scope host lo
> > valid_lft forever preferred_lft forever
> > inet6 ::1/128 scope host
> > valid_lft forever preferred_lft forever
> > 2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc fq_codel
> > state UP group default qlen 1000
> > link/ether a0:ce:c8:12:ed:05 brd ff:ff:ff:ff:ff:ff
> > inet 192.168.2.25/24 brd 192.168.2.255 scope global eth0
> > valid_lft forever preferred_lft forever
> > inet6 fe80::a2ce:c8ff:fe12:ed05/64 scope link
> > valid_lft forever preferred_lft forever
> > 3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> > fq_codel master tether state DORMANT group default qlen 1000
> > link/ether b8:27:eb:28:18:48 brd ff:ff:ff:ff:ff:ff
> > 4: tether: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc
> > noqueue state DOWN group default qlen 1000
> > link/ether 9a:69:3a:48:c1:32 brd ff:ff:ff:ff:ff:ff
> > inet 192.168.0.1/24 brd 192.168.0.255 scope global tether
> > valid_lft forever preferred_lft forever
> > inet6 fe80::d024:5eff:fe80:1a57/64 scope link
> > valid_lft forever preferred_lft forever
> > # iwctl device wlan0 show
> > Device: wlan0
> >
> > --------------------------------------------------------------------------------
> > Settable Property Value
> >
> > --------------------------------------------------------------------------------
> > Name wlan0
> > * Mode ap
> > * Powered on
> > Address b8:27:eb:28:18:48
> > Adapter phy0
> >
>
> I get these responses in the journal when I try to connect but it never
> connects:
>
> > src/netdev.c:netdev_mlme_notify() MLME notification New Station(19)
> > src/netdev.c:netdev_mlme_notify() MLME notification Del Station(20)
> > src/netdev.c:netdev_mlme_notify() MLME notification Del Station(20)
> >
Did you try to run iwd with debug enabled 'iwd -d'? Maybe there is more
info. And if there isn't any clue, the best way forward is to get
nlmon running and provide the information the iwd developers. From what I
see ConnMan is talking to iwd and setups the AP mode.
> I currently use hostapd and dnsmasq to have this headless RPi audio
> appliance work as an AP for initial setup, but want to remove hostapd and
> dnsmasq if I can get connman/iwd to do the same thing. I tried to get iwd
> to go into ap mode and connect, but cannot do it there, either. I do get
> some messages at startup of iwd. I do not think these are the problem, but
> they are missing kernel modules:
>
> No Diffie-Hellman support found, WPS will not be available
> > No asymmetric key support found.
> > TLS based WPA-Enterprise authentication methods will not function.
> > Kernel 4.20+ is required for this feature.
> > The following options are missing in the kernel:
> > CONFIG_ASYMMETRIC_KEY_TYPE
> > CONFIG_KEY_DH_OPERATIONS
> > CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE
> > CONFIG_PKCS7_MESSAGE_PARSER
> > CONFIG_X509_CERTIFICATE_PARSER
> > CONFIG_PKCS8_PRIVATE_KEY_PARSER
> > Wireless daemon version 1.6
I don't know but I would suggest to address this in the same go when you build
a new kernel with nlmon support.
Thanks,
Daniel
9 months
IP Accounting for WiFi Clients
by guna.aravind@gmail.com
Currently i don't see the IP accounting feature is conman for WiFi Clients.
I like to contribute the implementation for IP Accounting for WiFi Clients. Can somebody provide the procedure to contribute.
9 months, 1 week
connmanctl services --all?
by Nuno Gonçalves
Hi,
I find myself wanting to obtain the connman service configuration when
there is a only 1 or 2 services.
It would be nice if there would be a option to dump all services state,
like connmanctl dump or connmanctl services --all.
Any comments before I would invest time in such a patch?
Thanks,
Nuno
9 months, 1 week
Wifi Tethering
by KeithG
I cannot get this to work. The instructions are sketchy, but this is what I
did:
Made sure hostapd dwas not running. Made sure dnsmasq was not running.
Disconnected any wifi ssid in connman. Deleted any configs in
/var/lib/connman. Disabled wifi, Made sure that connman was not being
started with '-dnsnoproxy'. Enabled wifi tethering then issued the command
'connmanctl tether wifi on myssid password'.
I get this:
# connmanctl tether wifi on myssid password
Wifi SSID set
Wifi passphrase set
Enabled tethering for wifi
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc fq_codel
state UP group default qlen 1000
link/ether a0:ce:c8:12:ed:05 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.25/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a2ce:c8ff:fe12:ed05/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
fq_codel master tether state DORMANT group default qlen 1000
link/ether b8:27:eb:28:18:48 brd ff:ff:ff:ff:ff:ff
4: tether: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc
noqueue state DOWN group default qlen 1000
link/ether 9a:69:3a:48:c1:32 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/24 brd 192.168.0.255 scope global tether
valid_lft forever preferred_lft forever
inet6 fe80::c20:1dff:fe0a:815c/64 scope link
valid_lft forever preferred_lft forever
When I do so, I can see that tether is listed as an ip addr. I can see it
being advertised. When I try to connect, though, I get some error and it
will not connect. On Windows, it is 'Can't connect to this network'. On my
phone (android) it is:'Authentication Problem'. The journal on the RPi I am
running this on shows a core dump:
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {RX} 634 packets 49131 bytes
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {TX} 279 packets 44452 bytes
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {newlink} index 3 address
B8:27:EB:28:18:48 mtu 1500
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {newlink} index 3 operstate
5 <DORMANT>
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {RX} 634 packets 49131 bytes
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {TX} 279 packets 44452 bytes
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {newlink} index 3 address
B8:27:EB:28:18:48 mtu 1500
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {newlink} index 3 operstate
5 <DORMANT>
Apr 23 13:32:58 runeaudio connmand[1647]: tether {RX} 0 packets 0 bytes
Apr 23 13:32:58 runeaudio connmand[1647]: tether {TX} 6 packets 1142 bytes
Apr 23 13:32:58 runeaudio connmand[1647]: tether {newlink} index 4 address
9A:69:3A:48:C1:32 mtu 1500
Apr 23 13:32:58 runeaudio connmand[1647]: tether {newlink} index 4
operstate 0 <UNKNOWN>
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {newlink} index 3 address
B8:27:EB:28:18:48 mtu 1500
Apr 23 13:32:58 runeaudio connmand[1647]: wlan0 {newlink} index 3 operstate
5 <DORMANT>
Apr 23 13:32:58 runeaudio systemd[1]: Created slice
system-systemd\x2dcoredump.slice.
Apr 23 13:32:58 runeaudio systemd[1]: Started Process Core Dump (PID
1668/UID 0).
Apr 23 13:32:59 runeaudio connmand[1647]: tether {RX} 0 packets 0 bytes
Apr 23 13:32:59 runeaudio connmand[1647]: tether {TX} 12 packets 2970 bytes
Apr 23 13:32:59 runeaudio connmand[1647]: tether {update} flags 36867 <UP>
Apr 23 13:32:59 runeaudio connmand[1647]: tether {newlink} index 4 address
9A:69:3A:48:C1:32 mtu 1500
Apr 23 13:32:59 runeaudio connmand[1647]: tether {newlink} index 4
operstate 2 <DOWN>
Apr 23 13:32:59 runeaudio connman-vpnd[278]: tether {update} flags 36867
<UP>
Apr 23 13:32:59 runeaudio connman-vpnd[278]: tether {newlink} index 4
address 9A:69:3A:48:C1:32 mtu 1500
Apr 23 13:32:59 runeaudio connman-vpnd[278]: tether {newlink} index 4
operstate 2 <DOWN>
Apr 23 13:33:00 runeaudio avahi-daemon[212]: Registering new address record
for fe80::c20:1dff:fe0a:815c on tether.*.
Apr 23 13:33:00 runeaudio systemd-udevd[175]: Worker [1666] terminated by
signal 11 (SEGV)
Apr 23 13:33:00 runeaudio systemd-udevd[175]: tether: Worker [1666] failed
Apr 23 13:33:00 runeaudio systemd-coredump[1672]: Process 1666
(systemd-udevd) of user 0 dumped core.
Stack trace of thread
1666:
#0 0x0000000000472c84
n/a (systemd-udevd + 0x30c84)
Apr 23 13:33:00 runeaudio systemd[1]: systemd-coredump(a)0-1668-0.service:
Succeeded.
Apr 23 13:33:24 runeaudio systemd[1]: Starting Cleanup of Temporary
Directories...
Apr 23 13:33:24 runeaudio systemd[1]: systemd-tmpfiles-clean.service:
Succeeded.
Apr 23 13:33:24 runeaudio systemd[1]: Finished Cleanup of Temporary
Directories.
Any help?
Regards,
Keith
10 months, 1 week
Does connman support Ethernet connection using EAP
authentication(IEEE802.1X)?
by Nishant Chaprana
Hi,
I am trying to establish Ethernet connection in EAP (IEEE802.1x) enabled network.
I was not able to find the code related to EAP for Ethernet in connman's plugin/ethernet.c.
Does connman support Ethernet connection using EAP authentication(IEEE802.1X)?
Thanks and Regards
Nishant Chaprana
10 months, 1 week
[PATCH] vpn: Send D-Bus response when connecting for daemon-less setups
by Daniel Wagner
Pass in the callback to the connect() call to allow the plugin to
trigger the D-Bus response when done.
ConnMan was complaining it didn't receive a reply for the Connect2
call.
---
vpn/plugins/vpn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index e04670c85d13..30517a1153ab 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -632,7 +632,7 @@ static int vpn_connect(struct vpn_provider *provider,
vpn_driver_data->vpn_driver->flags & VPN_FLAG_NO_DAEMON) {
ret = vpn_driver_data->vpn_driver->connect(provider,
- NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, cb, dbus_sender, user_data);
if (ret) {
stop_vpn(provider);
goto exist_err;
--
2.26.0
10 months, 2 weeks