diff mbox series

nl80211: Do not allow off channel when frequency is not specified

Message ID 20231129084358.500949-1-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series nl80211: Do not allow off channel when frequency is not specified | expand

Commit Message

Andrei Otcheretianski Nov. 29, 2023, 8:43 a.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

Do not allow offchannel operation for action frame transmission if
no frequency is specified, as this doesn't make sense.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/drivers/driver_nl80211.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jouni Malinen Dec. 2, 2023, 6:59 p.m. UTC | #1
On Wed, Nov 29, 2023 at 10:43:58AM +0200, Andrei Otcheretianski wrote:
> Do not allow offchannel operation for action frame transmission if
> no frequency is specified, as this doesn't make sense.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 03d54222bb..56c00736df 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9151,6 +9151,9 @@  static int wpa_driver_nl80211_send_action(struct i802_bss *bss,
 	    bss->flink->beacon_set)
 		offchanok = 0;
 
+	if (!freq && is_sta_interface(drv->nlmode))
+		offchanok = 0;
+
 	wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
 		   "freq=%u MHz wait=%d ms no_cck=%d offchanok=%d)",
 		   drv->ifindex, freq, wait_time, no_cck, offchanok);