aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ieee80211.h12
-rw-r--r--net/mac80211/rx.c15
2 files changed, 21 insertions, 6 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 52e15e079c61..0aa831467493 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -472,7 +472,7 @@ static inline int ieee80211_is_cfendack(__le16 fc)
472} 472}
473 473
474/** 474/**
475 * ieee80211_is_nullfunc - check if FTYPE=IEEE80211_FTYPE_DATA and STYPE=IEEE80211_STYPE_NULLFUNC 475 * ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame
476 * @fc: frame control bytes in little-endian byteorder 476 * @fc: frame control bytes in little-endian byteorder
477 */ 477 */
478static inline int ieee80211_is_nullfunc(__le16 fc) 478static inline int ieee80211_is_nullfunc(__le16 fc)
@@ -481,6 +481,16 @@ static inline int ieee80211_is_nullfunc(__le16 fc)
481 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); 481 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
482} 482}
483 483
484/**
485 * ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame
486 * @fc: frame control bytes in little-endian byteorder
487 */
488static inline int ieee80211_is_qos_nullfunc(__le16 fc)
489{
490 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
491 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
492}
493
484struct ieee80211s_hdr { 494struct ieee80211s_hdr {
485 u8 flags; 495 u8 flags;
486 u8 ttl; 496 u8 ttl;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index f862399f7ce1..51cb8bc3af81 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -886,12 +886,17 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
886 } 886 }
887 } 887 }
888 888
889 /* Drop data::nullfunc frames silently, since they are used only to 889 /*
890 * control station power saving mode. */ 890 * Drop (qos-)data::nullfunc frames silently, since they
891 if (ieee80211_is_nullfunc(hdr->frame_control)) { 891 * are used only to control station power saving mode.
892 */
893 if (ieee80211_is_nullfunc(hdr->frame_control) ||
894 ieee80211_is_qos_nullfunc(hdr->frame_control)) {
892 I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc); 895 I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc);
893 /* Update counter and free packet here to avoid counting this 896 /*
894 * as a dropped packed. */ 897 * Update counter and free packet here to avoid
898 * counting this as a dropped packed.
899 */
895 sta->rx_packets++; 900 sta->rx_packets++;
896 dev_kfree_skb(rx->skb); 901 dev_kfree_skb(rx->skb);
897 return RX_QUEUED; 902 return RX_QUEUED;