[PATCH 7/7] 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 d5a8231c4..b9d43871e 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -224,6 +224,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 413d6f757..35dd3fe3b 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -867,7 +867,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.24.1
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.