[PATCH v2 09/11] nl80211: correctly handle deauth from scan with ctrl port rx

Markus Theil <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
Use socket with owner set on deauthenticate from scan. Export helper
method therefore.

Signed-off-by: Markus Theil <[email protected]>
---
 src/drivers/driver_nl80211.h      | 1 +
 src/drivers/driver_nl80211_scan.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
index f3513b369..68d089560 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -229,6 +229,7 @@ struct nl_msg * nl80211_bss_msg(struct i802_bss *bss, int flags, uint8_t cmd);
 int send_and_recv_msgs(struct wpa_driver_nl80211_data *drv, struct nl_msg *msg,
 		       int (*valid_handler)(struct nl_msg *, void *),
 		       void *valid_data);
+struct nl_sock* get_connect_or_ctrl_handle(struct i802_bss *bss);
 int nl80211_create_iface(struct wpa_driver_nl80211_data *drv,
 			 const char *ifname, enum nl80211_iftype iftype,
 			 const u8 *addr, int wds,
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 04f6bb879..2e2ba9f56 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -872,7 +872,7 @@ static void clear_state_mismatch(struct wpa_driver_nl80211_data *drv,
 		wpa_driver_nl80211_mlme(drv, addr,
 					NL80211_CMD_DEAUTHENTICATE,
 					WLAN_REASON_PREV_AUTH_NOT_VALID, 1,
-					NULL);
+					get_connect_or_ctrl_handle(drv->first_bss));
 	}
 }
 
-- 
2.26.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.