[PATCH] hostapd: Fix eapol packet drop in bridged Soft AP mode

Les Lee lesl at google.com
Mon Apr 26 09:59:39 BST 2021


In this patch, we fix a bug which is eapol rx packet drop in hostapd
when interface configured to bridged AP mode.

Issue scenario:

When the AP interface needs to do scan for some reason, for instance:
HT SCAN for bandwidth check. It needs to configure AP interface mode
to STA. In current hostapd design, it will remove bridged link in
temporary and add it back when scan done. But it doesn't add ifindex
link back between bridged interface and AP interface. It will cause
eapol rx packet drop in hostapd because eapol packet is being received
from bridged interface. But it doesn't exist because it was removed
when interface reconfigure to STA mode.


Add ifindex link back when reset to AP mode.

Related log,
// HT scan causes interface(wlan3) re-configure to STA mode and it
causes wlan3 delink with ap_br_wlan2
03-29 17:12:23.225 D/hostapd ( 8979): Receive wpa msg : ACS-COMPLETED
freq=5180 channel=36
03-29 17:12:23.225 I/hostapd ( 8979): wlan3: interface state
03-29 17:12:23.225 D/hostapd ( 8979): nl80211: Set mode ifindex 28
iftype 2 (STATION)
03-29 17:12:23.261 D/hostapd ( 8979): nl80211: Remove AP interface
wlan3 temporarily from the bridge ap_br_wlan2 to allow its mode to be
set to STATION
03-29 17:12:23.321 D/hostapd ( 8979): RTM_NEWLINK: ifi_index=29
ifname=ap_br_wlan2 operstate=6 linkmode=0 ifi_family=0
ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])

// After scanning, hostapd handle add interface (wlan3) back into the
bridge ap_br_wlan2 but it doesn't add ifindex back
03-29 17:12:23.436 D/hostapd ( 8979): nl80211: Add AP interface wlan3
back into the bridge ap_br_wlan2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-hostapd-Fix-eapol-packet-drop-in-bridged-mode.patch
Type: application/octet-stream
Size: 1898 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20210426/e4f53d22/attachment.obj>

More information about the Hostap mailing list