Hi all!

Happy holidays to anyone celebrating today.

I'm writing about an issue I found with TDLS breaking my Wi-Fi
connection on a laptop MediaTek modem (MT7921). This seems to be
reported in numerous other places, although most users didn't manage to
track the issue all the way to its source. I'm hoping that other people
can confirm affected models and help me put together an actionable bug
report and figure out where to send it (either to wpa_supplicant or to
specific kernel driver mailing lists).

TDLS is a Wi-Fi protocol allowing the creation of direct connections
between two Wi-Fi clients on the same local network segment, without
disrupting the existing connection. [1] Support for TDLS in
wpa_supplicant has been enabled by default since version 2.9 [2] and
Arch Linux apparently enabled it before that.

Applications like KDE Connect that transfer data between an Android
device and a PC can cause these TDLS connections to be initiated. A
quick search of the KDE Connect code base turned up nothing for TDLS,
and so I think wpa_supplicant is creating these connections
automatically in response to large transfers between Wi-Fi clients.
(Alternatively, perhaps the Android networking stack detects support
for TDLS and tries to create the connection.) KDE Connect therefore
frequently turns up in reports of this issue, although I have also seen
Syncthing and even ssh mentioned as well.

For me, the problem can reliably be reproduced in the following way:
when connected (via NetworkManager + wpa_supplicant) to the same access
point as my phone, I try to send a file from my phone (Android) to my
computer using KDE Connect. This will generally work. Additional files,
however, will transfer very slowly or fail entirely. Around the same
time, the Internet connection on my computer will suddenly become
slower (but not break entirely, which is why it took me a long time to
figure out the problem). The source of the issue seems to be this:
after wpa_supplicant tries to initiate a TDLS connection with my phone,
the rate of dropped packets between my computer and my access point
goes up, disrupting and slowing my connections (and usually breaking
KDE Connect itself). Some users have even reported that they are
de-authed from their access point, resetting the connection (which has
the side effect of fixing the issue with dropped packets). [3]

This causes the following log entry to appear:

Jun 21 15:54:09 wpa_supplicant[2470]: TDLS: Creating peer entry for  
0e:4d:96:35:0e:38
Jun 21 15:54:09 wpa_supplicant[2470]: TDLS: Dialog Token in TPK M1 1
Jun 21 15:54:09 wpa_supplicant[2470]: nl80211: kernel reports: key addition 
failed
Jun 21 15:54:09 wpa_supplicant[2470]: TDLS: Failed to set TPK to the driver

Many users have reported effectively this same issue where TDLS breaks
their Internet connection, and they almost all have this same log
entry. Here is a sampling: [4] [5] [6] [7] [8] [9] [10].

Some users resolved their issue by switching the NetworkManager backend
to iwd. I confirmed that this fixes my issue too. I believe, however,
this the reason this works is probably that iwd doesn't support the
TDLS protocol. There's a bug here, and the ideal resolution would be to
get a fix for it either in wpa_supplicant or in the individual WiFi
drivers that may have issues.

I was also able to resolve the issue by simply rebuilding the latest
Arch Linux wpa_supplicant package while disabling the CONFIG_TDLS build
option.

My problem at this point is that I'm not sure how to get any further
information that might help developers find and resolve the bug. Any
help with this would be appreciated!

Warmly,

Liliane


[1] https://en.wikipedia.org/wiki/TDLS

[2] https://git.w1.fi/cgit/hostap/commit/?id=39f29f250a

[3] 
https://www.reddit.com/r/kde/comments/1lha5x8/cant_send_files_using_kde_connect_on_wpa/

[4] https://bbs.archlinux.org/viewtopic.php?id=276748

[5] https://bbs.archlinux.org/viewtopic.php?id=283498

[6] 
https://www.reddit.com/r/linuxquestions/comments/12ge74g/uploading_big_files_freezes_the_network/

[7] 
https://discussion.fedoraproject.org/t/laptop-freezes-after-updated-to-kernel-6-4-x/88023

[8] 
https://discussion.fedoraproject.org/t/network-gets-cut-off-when-connecting-to-android-14-wpa-supplicant/151557

[9] https://bbs.archlinux.org/viewtopic.php?id=256314

[10] https://github.com/GSConnect/gnome-shell-extension-gsconnect/issues/530

Reply via email to