"nl80211 driver interface is not designed to be used with ap_scan=2"

Bug #1886169 reported by durex
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
wpasupplicant (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Ubuntu 20.04 LTS ARM (Running on a raspberry Pi)

********
Logfile:
********

NetworkManager[1345]: <info> [1593736912.7230] policy: auto-activating connection 'hotspot-inside' (37c28408-978a-48e0-a135-9867e3a45c64)
NetworkManager[1345]: <info> [1593736912.7248] device (wlx00c0caab435c): Activation: starting connection 'hotspot-inside' (37c28408-978a-48e0-a135-9867e3a45c64)
NetworkManager[1345]: <info> [1593736912.7252] device (wlx00c0caab435c): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
NetworkManager[1345]: <info> [1593736912.7261] manager: NetworkManager state is now CONNECTING
NetworkManager[1345]: <info> [1593736912.7449] device (wlx00c0caab435c): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
NetworkManager[1345]: <info> [1593736912.7459] device (wlx00c0caab435c): Activation: (wifi) access point 'hotspot-inside' has security, but secrets are required.
NetworkManager[1345]: <info> [1593736912.7460] device (wlx00c0caab435c): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
NetworkManager[1345]: <info> [1593736912.7530] device (wlx00c0caab435c): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
NetworkManager[1345]: <info> [1593736912.7557] device (wlx00c0caab435c): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
NetworkManager[1345]: <info> [1593736912.7566] device (wlx00c0caab435c): Activation: (wifi) connection 'hotspot-inside' has security, and secrets exist. No new secrets needed.
NetworkManager[1345]: <info> [1593736912.7571] Config: added 'ssid' value 'hotspot-inside'
NetworkManager[1345]: <info> [1593736912.7572] Config: added 'mode' value '2'
NetworkManager[1345]: <info> [1593736912.7573] Config: added 'frequency' value '2412'
NetworkManager[1345]: <info> [1593736912.7574] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK'
NetworkManager[1345]: <info> [1593736912.7574] Config: added 'psk' value '<hidden>'
NetworkManager[1345]: <info> [1593736912.7575] Config: added 'proto' value 'RSN'
NetworkManager[1345]: <info> [1593736912.7575] Config: added 'pairwise' value 'CCMP'
NetworkManager[1345]: <info> [1593736912.7576] Config: added 'group' value 'CCMP'
wpa_supplicant[1358]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this can result in connection failures
wpa_supplicant[1358]: Using interface wlx00c0caab435c with hwaddr 00:c0:ca:ab:43:5c and ssid "hotspot-inside"

*************************************
NetworkManager Connection definition:
*************************************

[connection]
id=hotspot-inside
uuid=37c28408-978a-48e0-a135-9867e3a45c64
type=wifi
autoconnect-priority=5
permissions=
timestamp=1593537574

[wifi]
mac-address=00:C0:CA:AB:43:5C
mac-address-blacklist=
mode=ap
seen-bssids=00:C0:CA:AB:43:5C;DC:A6:32:3A:67:FC;
ssid=hotspot-inside

[wifi-security]
group=ccmp;
key-mgmt=wpa-psk
pairwise=ccmp;
proto=rsn;
psk=<XXX>

[ipv4]
dns-search=
method=shared

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=ignore

[proxy]

*****************************
USB Network Card information:
*****************************

*-network:1
   description: Wireless interface
   physical id: 2
   bus info: usb@1:1.1
   logical name: wlx00c0caab435c
   serial: 00:c0:ca:ab:43:5c
   capabilities: ethernet physical wireless
   configuration: broadcast=yes driver=rtl88XXau ip=10.42.0.1 multicast=yes wireless=IEEE 802.11bgn

(The device is an Alfa AWUS036AC, using the driver https://github.com/aircrack-ng/rtl8812au - Version 5.6.4.2)

**************************
What I expected to happen:
**************************
I expect my windows 10 PC to be able to connect to a hotspot if I set one up

**********************
What happened instead:
**********************
It can't connect to the AP

***********************
Logs of when I connect:
***********************
wpa_supplicant[1358]: wlx00c0caab435c: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0

... this is the only line that appears in the logs and on the windows machine, I get the very helpful description of "Can't connect"...

******************
What I did so far:
******************
I tried reading about the ap_scan modes what I could find.
The only two references I did find, was:
- that ap_mode is a setting you can set in wpa_supplicant, however, I'm using NetworkManager. I checked the references and I don't find a way to set 'ap_mode=1'
- all other references were bugreports, which led me to here.
I ordered a new Network Card, using a different chipset, to see if the problem persists. Sadly it didn't arrive yet.

Revision history for this message
durex (durexlw) wrote :

Weird... I thought I selected 'wpasupplicant' as affected package. Sorry for the mistake

description: updated
Revision history for this message
Dan Watkins (oddbloke) wrote :

No worries, I've just moved it there. :)

no longer affects: cloud-init (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in wpasupplicant (Ubuntu):
status: New → Confirmed
Revision history for this message
Rainer (fullerf) wrote :

hotspot function also fails for me

checked
/etc/NetworkManager/NetworkManager.conf:wifi.scan-rand-mac-address=no
also
grep -r 'ap_scan=2' /etc
turned up nothing so i am puzzled where/why ap_scan=2 would be set

installed hostapd pkg but this did not fix it

tangential:
seems redhat had this failure mode in 2017 and nixos in 2019, dunno if related, workarounds vary
https://github.com/NixOS/nixpkgs/issues/67956

https://bugzilla.redhat.com/show_bug.cgi?id=1463245
https://bugzilla.redhat.com/show_bug.cgi?id=1518190
probably related to
https://marc.info/?l=linux-kernel&m=151221956904515&w=2

Revision history for this message
Rainer (fullerf) wrote :

add: DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"

Revision history for this message
Rainer (fullerf) wrote :

add: error/failure only happens when security is set to WPA3-Personal
WPA2 hotspot works fine!

this is: Intel Wireless 8260 driver=iwlwifi-5.4.0-42 firmware=36.77d01142.0

Revision history for this message
durex (durexlw) wrote :

I currently disagree on the WPA3 relation.

From "nmcli d show":

802-11-wireless-security.key-mgmt: wpa-psk

From "lshw -class network":

configuration: broadcast=yes driver=rtl88XXau ip=10.42.0.1 multicast=yes wireless=IEEE 802.11bgn

From "sudo iwlist wlan0 scanning" from another PC and isolating my own AP:

                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=52/70 Signal level=-58 dBm
                    Encryption key:on
                    ESSID:"hotspot-inside"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 100ms ago
                    IE: Unknown: 000E686F7473706F742D696E73696465
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030101
                    IE: Unknown: 2A0104
                    IE: Unknown: 32043048606C
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (2) : PSK unknown (6)
                    IE: Unknown: 2D1A3C0A1FFFFF00000000000000002C010100000000000000000000
                    IE: Unknown: 3D1601000000000000000000000000000000000000000000
                    IE: Unknown: DD180050F2020101810003A4000027A4000042435D0062322E00
                    IE: Unknown: DD5C0050F204104A0001101044000102103B000103104700100157F558E17B51C98DC14CDEAE50195910210001
2010230001201024000120104200012010540008000000000000000010110001201008000231481049000600372A000120
                    IE: Unknown: DD0700E04C00020004

Note the "IEEE 802.11i/WPA2 Version 1"

Revision history for this message
rerdavies (rerdavies) wrote :

Supplementary information you may find useful.

The Wi-Fi module on Pi-4 is not able to act as an Access Point *and* scan for wi-fi addresses at the same time. On Raspbian, this is dealt with by (1) specifying a fixed channel; and (2) adding the following line to /etc/dhcpcd.conf:

   nohook wpa_supplicant

and (3) disabling (masking?) the wpa_supplicant service.

If the wpa_supplicant service is running, any attempt to scan for wi-fi devices will take down the access point connection.

For some reason, on Rasbiam (Debian derived), the network manager *fork*s wpa_supplicant in order to do a wifi scan when restarting, if the wpa_supplicant service has been disabled or masked, unless the nohook wpa_supplicant line is added. This happens early in the network manager restart, and can cause various unpleasant symptoms ranging from occasional drops all the way up to a fullblown deathspiral of all network services depending on timing.

I'm not sure what the equivalent fix is on Ubuntu; but my reading of the message is:

  "This device is not able to do wi-fi scans when operating as an access point".

I'm currently running Ubuntu 21.04, which uses a different network stack, I think (no wpa_supplicant, no hostapd), so I can't try workarounds myself. It sounds like 18.04 is using the old network stack, so the raspbian changes will probably work on Ubuntu 18.04 as well.

In the meantime, I'm going to resume my search for the equivalent fix for an almost identical problem on the new network stack used by 21.04. :-P

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.