aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ieee80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ieee80211.h')
-rw-r--r--include/linux/ieee80211.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b118744d3382..a80516fd65c8 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -19,6 +19,7 @@
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/if_ether.h> 21#include <linux/if_ether.h>
22#include <linux/etherdevice.h>
22#include <asm/byteorder.h> 23#include <asm/byteorder.h>
23#include <asm/unaligned.h> 24#include <asm/unaligned.h>
24 25
@@ -2464,7 +2465,7 @@ static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
2464 */ 2465 */
2465static inline bool ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) 2466static inline bool ieee80211_is_robust_mgmt_frame(struct sk_buff *skb)
2466{ 2467{
2467 if (skb->len < 25) 2468 if (skb->len < IEEE80211_MIN_ACTION_SIZE)
2468 return false; 2469 return false;
2469 return _ieee80211_is_robust_mgmt_frame((void *)skb->data); 2470 return _ieee80211_is_robust_mgmt_frame((void *)skb->data);
2470} 2471}
@@ -2487,6 +2488,35 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
2487} 2488}
2488 2489
2489/** 2490/**
2491 * _ieee80211_is_group_privacy_action - check if frame is a group addressed
2492 * privacy action frame
2493 * @hdr: the frame
2494 */
2495static inline bool _ieee80211_is_group_privacy_action(struct ieee80211_hdr *hdr)
2496{
2497 struct ieee80211_mgmt *mgmt = (void *)hdr;
2498
2499 if (!ieee80211_is_action(hdr->frame_control) ||
2500 !is_multicast_ether_addr(hdr->addr1))
2501 return false;
2502
2503 return mgmt->u.action.category == WLAN_CATEGORY_MESH_ACTION ||
2504 mgmt->u.action.category == WLAN_CATEGORY_MULTIHOP_ACTION;
2505}
2506
2507/**
2508 * ieee80211_is_group_privacy_action - check if frame is a group addressed
2509 * privacy action frame
2510 * @skb: the skb containing the frame, length will be checked
2511 */
2512static inline bool ieee80211_is_group_privacy_action(struct sk_buff *skb)
2513{
2514 if (skb->len < IEEE80211_MIN_ACTION_SIZE)
2515 return false;
2516 return _ieee80211_is_group_privacy_action((void *)skb->data);
2517}
2518
2519/**
2490 * ieee80211_tu_to_usec - convert time units (TU) to microseconds 2520 * ieee80211_tu_to_usec - convert time units (TU) to microseconds
2491 * @tu: the TUs 2521 * @tu: the TUs
2492 */ 2522 */