Search Linux Wireless

[PATCH] wifi: mac80211: support ieee80211_ext format

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

 



From: Kieran Frewen <kieran.frewen@xxxxxxxxxxxxxx>

Ensure S1G beacons use the new ieee80211_ext format when required.

Signed-off-by: Kieran Frewen <kieran.frewen@xxxxxxxxxxxxxx>
Co-developed-by: Gilad Itzkovitch <gilad.itzkovitch@xxxxxxxxxxxxxx>
Signed-off-by: Gilad Itzkovitch <gilad.itzkovitch@xxxxxxxxxxxxxx>
---
 net/mac80211/rx.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index db3451f5f2fb..74027486a6b9 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -5048,6 +5048,15 @@ static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx,
 	struct ieee80211_hdr *hdr = (void *)skb->data;
 	struct sta_info *sta;
 	int link_id = -1;
+	const u8 *addr;
+
+	if (ieee80211_is_s1g_beacon(hdr->frame_control)) {
+		struct ieee80211_ext *ext_hdr = (struct ieee80211_ext *)skb->data;
+
+		addr = ext_hdr->u.s1g_beacon.sa;
+	} else {
+		addr = hdr->addr2;
+	}
 
 	/*
 	 * Look up link station first, in case there's a
@@ -5055,14 +5064,14 @@ static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx,
 	 * is identical to the MLD address, that way we'll
 	 * have the link information if needed.
 	 */
-	link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2);
+	link_sta = link_sta_info_get_bss(rx->sdata, addr);
 	if (link_sta) {
 		sta = link_sta->sta;
 		link_id = link_sta->link_id;
 	} else {
 		struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
 
-		sta = sta_info_get_bss(rx->sdata, hdr->addr2);
+		sta = sta_info_get_bss(rx->sdata, addr);
 		if (status->link_valid)
 			link_id = status->link_id;
 	}
@@ -5102,7 +5111,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
 	if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc))
 		I802_DEBUG_INC(local->dot11ReceivedFragmentCount);
 
-	if (ieee80211_is_mgmt(fc)) {
+	if (ieee80211_is_mgmt(fc) || ieee80211_is_ext(fc)) {
 		/* drop frame if too short for header */
 		if (skb->len < ieee80211_hdrlen(fc))
 			err = -ENOBUFS;

base-commit: 9ae708f00161e1d789268fa9cc05bf6bec2af474
-- 
2.34.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux