802.11r Troubleshooting [ath9k+ath10k]

I lowered the log-level of hostapd to 1 because i wanted to test 802.11r authentication flow and discovered the following problem:

Tue Dec  3 22:51:23 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: binding station to interface 'wlan1'
Tue Dec  3 22:51:23 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: authentication OK (FT)
Tue Dec  3 22:51:23 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff MLME: MLME-AUTHENTICATE.indication(90:2b:d2:ff:ff:ff, FT)
Tue Dec  3 22:51:23 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: association OK (aid 1)
Tue Dec  3 22:51:23 2019 daemon.notice hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: Could not set STA to kernel driver
Tue Dec  3 22:51:24 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: association OK (aid 1)
Tue Dec  3 22:51:24 2019 daemon.notice hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: Could not set STA to kernel driver
Tue Dec  3 22:51:24 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: association OK (aid 1)
Tue Dec  3 22:51:24 2019 daemon.notice hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: Could not set STA to kernel driver
Tue Dec  3 22:51:24 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: association OK (aid 1)
Tue Dec  3 22:51:24 2019 daemon.notice hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: Could not set STA to kernel driver
Tue Dec  3 22:51:25 2019 daemon.debug hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: association OK (aid 1)
Tue Dec  3 22:51:25 2019 daemon.notice hostapd: wlan1: STA 90:2b:d2:ff:ff:ff IEEE 802.11: Could not set STA to kernel driver
Tue Dec  3 22:51:25 2019 daemon.notice hostapd: wlan0: STA 90:2b:d2:ff:ff:ff IEEE 802.11: did not acknowledge authentication response

This is caused by the "missing" implementation of sta_add and the following call by hostapd:

static int add_associated_sta(...) -> int hostapd_sta_add(...) -> 
	if (hapd->driver->sta_add == NULL)
		return 0;

in the current ath9k and ath10k+(ct) drivers.

Im a bit puzzled why thats the case and im not sure im correct with this, but it seems like the interface from ath9k got removed in favor of sta_state
(https://github.com/torvalds/linux/commit/df3c6eb34da5ed61d288c23466e1ec4dd7ca509a)

Edit: it seems like ath10k(ct) does also not have this at all.

The question is, why does hostapd rely on the add call instead?
Where should i forward this to, as this behavior seems entirely broken to me.

PS: first time tinkering with wireless drivers, so please explain when i went wrong somewhere!

Quick check -- which version of OpenWrt and which of the ath9k/ath10k drivers are you using?

head /etc/board.json
fgrep OPENWRT_RELEASE /etc/os-release
uname -a
opkg list-installed | fgrep ath
1 Like

Quick answer:

root@main-uap:/etc/config# head /etc/board.json
{
	"model": {
		"id": "ubnt,unifiac-pro",
		"name": "Ubiquiti UniFi-AC-PRO"
	},
	"switch": {
		"switch0": {
			"enable": true,
			"reset": true,
			"ports": [
root@main-uap:/etc/config# fgrep OPENWRT_RELEASE /etc/os-release
OPENWRT_RELEASE="OpenWrt SNAPSHOT r11614+1-82a741c774"
root@main-uap:/etc/config# uname -a
Linux main-uap 4.19.86 #0 Sat Nov 30 12:39:36 2019 mips GNU/Linux
root@main-uap:/etc/config# opkg list-installed | fgrep ath
ath10k-firmware-qca988x-ct-htt - 2019-10-03-d622d160-1
kmod-ath - 4.19.86+5.4-rc8-1-1
kmod-ath10k-ct - 4.19.86+2019-11-07-080cd781-1
kmod-ath9k - 4.19.86+5.4-rc8-1-1
kmod-ath9k-common - 4.19.86+5.4-rc8-1-1

should have included this before heh.

I also pulled in the following patchset: https://patchwork.ozlabs.org/project/openwrt/list/?series=141862

Edit: it seems like this issue could be related to my previous post and the enabled optional MFP (Rekeying Issue - "driver can't safely do that.").

Edit2: this seems to be a bug in hostapd, as this line makes sure both ways to change state cant be set at the same time: https://github.com/torvalds/linux/blob/386403a115f95997c2715691226e11a7b5cffcfd/net/mac80211/main.c#L521

So for every driver missing add+remove in favor of state it would fail.

1 Like