Our application uses WiFi Access Point/AP mode (on uap0 interface) Station/STA mode (on mlan0 interface) simultaneously.
Sometimes this works, but other times I notice that the MAC address of the mlan0 and uap0 interfaces are the same, and this causes all kinds of confusion with the software and unreliable wifi networking. Usually the MAC addresses only differ by 2 in the 2nd last octet, but when this bug occurs the addresses are exactly the same:
:~# ip -c a ... 4: mlan0: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether dc:f5:05:11:39:35 brd ff:ff:ff:ff:ff:ff 5: uap0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether dc:f5:05:11:39:35 brd ff:ff:ff:ff:ff:ff inet 192.168.9.10/24 brd 192.168.9.255 scope global uap0 valid_lft forever preferred_lft forever inet6 fe80::def5:5ff:fe11:3935/64 scope link valid_lft forever preferred_lft forever
One way to trigger this bug is to restart hostapd (
systemctl restart hostapd), or to mannually take the uap0 interface up and down (
ip link set dev uap0 down && sleep 2 && ip link set dev uap0 up).
- How are these MAC addresses being assigned? Is it by the mwifiex driver?
- What is the solution to this problem? i.e. how to prevent this happening?
- Is there a way to recover once this issue is detected? (changing the MAC address did not seem to work for me, probably because hostapd is using the wrong one that it read at start and restarting hostapd causes the wrong/duplicate MAC to be set for uap0)
- Toradex Colibri iMX6ULL 512MB V1.1A
- Custom carrier board (similar to Iris)
- BSP 3
- Kernel version: 4.14.170-3.0.4+gbaa6c24240a4 #1 SMP Fri May 26 01:16:37 UTC 2023
- mwifiex details:
:~# modinfo mwifiex | grep version version: 1.0 description: Marvell WiFi-Ex Driver version 1.0 version: backported from Linux (v5.4.27-0-g585e0cc08069) using backports v5.4.27-1-0-gf6e8852f srcversion: F6DEC1EF0118FF52DA370FC vermagic: 4.14.170-3.0.4+gbaa6c24240a4 SMP mod_unload modversions ARMv7 p2v8
:~# cat /etc/hostapd.conf interface=uap0 ssid=my_ap hw_mode=g channel=3 own_ip_addr=192.168.9.10 wpa=2 wpa_passphrase=mypassword wpa_key_mgmt=WPA-PSK
:~# cat /etc/systemd/network/hostapd.network [Match] Name=uap0 [Network] Address=192.168.22.33/24 DHCPServer=yes