[PATCH 04/40] nl80211: Allow Tx status for authentication frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To support PASN authentication flow, where authentication
frames are sent by the wpa_supplicant using send_mlme() callback,
modify the logic in driver_nl80211 to also send EVENT_TX_STATUS
for authentication frames.

Signed-off-by: Ilan Peer <ilan.peer@xxxxxxxxx>
---
 src/drivers/driver_nl80211_event.c | 39 ++++++++++++++++++------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 7c16330662..f1cfe235f3 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -679,29 +679,36 @@ static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv,
 				      size_t len, struct nlattr *ack)
 {
 	union wpa_event_data event;
-	const struct ieee80211_hdr *hdr;
-	u16 fc;
+	const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *)frame;
+	u16 fc = le_to_host16(hdr->frame_control);
 
 	wpa_printf(MSG_DEBUG, "nl80211: Frame TX status event");
+
+	if (WLAN_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT)
+		return;
+
 	if (!is_ap_interface(drv->nlmode)) {
-		u64 cookie_val;
+		if (WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION) {
+			u64 cookie_val;
 
-		if (!cookie)
-			return;
+			if (!cookie)
+				return;
 
-		cookie_val = nla_get_u64(cookie);
-		wpa_printf(MSG_DEBUG, "nl80211: Action TX status:"
-			   " cookie=0x%llx%s (ack=%d)",
-			   (long long unsigned int) cookie_val,
-			   cookie_val == drv->send_action_cookie ?
-			   " (match)" : " (unknown)", ack != NULL);
-		if (cookie_val != drv->send_action_cookie)
-			return;
+			cookie_val = nla_get_u64(cookie);
+			wpa_printf(MSG_DEBUG,
+				   "nl80211: Action TX status: cookie=0x%llx%s (ack=%d)",
+				   (long long unsigned int)cookie_val,
+				   cookie_val == drv->send_action_cookie ?
+				   " (match)" : " (unknown)", !!ack);
+			if (cookie_val != drv->send_action_cookie)
+				return;
+		} else if (WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
+			wpa_printf(MSG_DEBUG,
+				   "nl80211: Auth TX status: ack=%d",
+				   !!ack);
+		}
 	}
 
-	hdr = (const struct ieee80211_hdr *) frame;
-	fc = le_to_host16(hdr->frame_control);
-
 	os_memset(&event, 0, sizeof(event));
 	event.tx_status.type = WLAN_FC_GET_TYPE(fc);
 	event.tx_status.stype = WLAN_FC_GET_STYPE(fc);
-- 
2.17.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux