diff mbox series

driver_nl80211: fix send_mlme to use monitor interface only for AP interface

Message ID 20210713190518.114105-1-ajay.kathat@microchip.com
State Accepted
Headers show
Series driver_nl80211: fix send_mlme to use monitor interface only for AP interface | expand

Commit Message

Ajay.Kathat@microchip.com July 13, 2021, 7:05 p.m. UTC
From: Ajay Singh <ajay.kathat@microchip.com>

Use monitor interface to send_mlme only when the interface is configured in AP
mode. In multiple interface setup, one interface can be configured in AP mode
using monitor interface and another interface in station mode. The station
interface may also require sending the management frames without using monitor
interface e.g support external SAE authentication to send AUTH frames without
monitor interface. This change allows sending management frames to driver for
station interface where AP interface uses monitor interface.

Additionally, the monitor interface is only valid for AP mode
(nl80211_create_monitor_interface() is called in nl80211_setup_ap) so interface
type check ensures to use monitor interface only when required by the specific
interface.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Peter Reen <peter.reen@microchip.com>
---
 src/drivers/driver_nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen Aug. 25, 2021, 1:53 p.m. UTC | #1
On Tue, Jul 13, 2021 at 07:05:23PM +0000, Ajay.Kathat@microchip.com wrote:
> Use monitor interface to send_mlme only when the interface is configured in AP
> mode. In multiple interface setup, one interface can be configured in AP mode
> using monitor interface and another interface in station mode. The station
> interface may also require sending the management frames without using monitor
> interface e.g support external SAE authentication to send AUTH frames without
> monitor interface. This change allows sending management frames to driver for
> station interface where AP interface uses monitor interface.
> 
> Additionally, the monitor interface is only valid for AP mode
> (nl80211_create_monitor_interface() is called in nl80211_setup_ap) so interface
> type check ensures to use monitor interface only when required by the specific
> interface.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 8eb033c78..41dc8f029 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4072,7 +4072,7 @@  static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data,
 		freq = bss->freq;
 	}
 
-	if (drv->use_monitor) {
+	if (drv->use_monitor && is_ap_interface(drv->nlmode)) {
 		wpa_printf(MSG_DEBUG,
 			   "nl80211: send_frame(freq=%u bss->freq=%u) -> send_monitor",
 			   freq, bss->freq);