mac80211: don't look at the PM bit of BAR frames
diff mbox

Message ID 20170608110049.8747-1-emmanuel.grumbach@intel.com
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Emmanuel Grumbach June 8, 2017, 11 a.m. UTC
When a peer sends a BAR frame with PM bit clear, we should
not modify its PM state as madated by the spec in
802.11-20012 10.2.1.2.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/rx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Igor Mitsyanko June 20, 2017, 9:57 p.m. UTC | #1
On 06/08/2017 04:00 AM, Emmanuel Grumbach wrote:
> When a peer sends a BAR frame with PM bit clear, we should
> not modify its PM state as madated by the spec in
> 802.11-20012 10.2.1.2.
> 
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>   net/mac80211/rx.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index e48724a6725e..bb1e4bbf55e2 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -1558,12 +1558,16 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
>   	 */
>   	if (!ieee80211_hw_check(&sta->local->hw, AP_LINK_PS) &&
>   	    !ieee80211_has_morefrags(hdr->frame_control) &&
> +	    !ieee80211_is_back_req(hdr->frame_control) &&

BTW latest spec also notes that PSPOLL frame has PM bit reserved too, 
because it may not result in ACK frame from AP.

>   	    !(status->rx_flags & IEEE80211_RX_DEFERRED_RELEASE) &&
>   	    (rx->sdata->vif.type == NL80211_IFTYPE_AP ||
>   	     rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&
> -	    /* PM bit is only checked in frames where it isn't reserved,
> +	    /*
> +	     * PM bit is only checked in frames where it isn't reserved,
>   	     * in AP mode it's reserved in non-bufferable management frames
>   	     * (cf. IEEE 802.11-2012 8.2.4.1.7 Power Management field)
> +	     * BAR frames should be ignored as specified in
> +	     * IEEE 802.11-2012 10.2.1.2.

Comment placement is a little confusing IMO. Maybe move 
ieee80211_is_back_req() check to this position?

>   	     */
>   	    (!ieee80211_is_mgmt(hdr->frame_control) ||
>   	     ieee80211_is_bufferable_mmpdu(hdr->frame_control))) {
>
Emmanuel Grumbach June 21, 2017, 5:59 a.m. UTC | #2
> 

> On 06/08/2017 04:00 AM, Emmanuel Grumbach wrote:

> > When a peer sends a BAR frame with PM bit clear, we should not modify

> > its PM state as madated by the spec in

> > 802.11-20012 10.2.1.2.

> >

> > Signed-off-by: Emmanuel Grumbach

> > <emmanuel.grumbach-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

> > ---

> >   net/mac80211/rx.c | 6 +++++-

> >   1 file changed, 5 insertions(+), 1 deletion(-)

> >

> > diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index

> > e48724a6725e..bb1e4bbf55e2 100644

> > --- a/net/mac80211/rx.c

> > +++ b/net/mac80211/rx.c

> > @@ -1558,12 +1558,16 @@ ieee80211_rx_h_sta_process(struct

> ieee80211_rx_data *rx)

> >   	 */

> >   	if (!ieee80211_hw_check(&sta->local->hw, AP_LINK_PS) &&

> >   	    !ieee80211_has_morefrags(hdr->frame_control) &&

> > +	    !ieee80211_is_back_req(hdr->frame_control) &&

> 

> BTW latest spec also notes that PSPOLL frame has PM bit reserved too,

> because it may not result in ACK frame from AP.


PS poll are already handled before in the flow and don't reach this code.


> 

> >   	    !(status->rx_flags & IEEE80211_RX_DEFERRED_RELEASE) &&

> >   	    (rx->sdata->vif.type == NL80211_IFTYPE_AP ||

> >   	     rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&

> > -	    /* PM bit is only checked in frames where it isn't reserved,

> > +	    /*

> > +	     * PM bit is only checked in frames where it isn't reserved,

> >   	     * in AP mode it's reserved in non-bufferable management frames

> >   	     * (cf. IEEE 802.11-2012 8.2.4.1.7 Power Management field)

> > +	     * BAR frames should be ignored as specified in

> > +	     * IEEE 802.11-2012 10.2.1.2.

> 

> Comment placement is a little confusing IMO. Maybe move

> ieee80211_is_back_req() check to this position?

> 


Don't know. It's been merged already. So you'd need to send a patch fixing this if you want :)

Patch
diff mbox

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index e48724a6725e..bb1e4bbf55e2 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1558,12 +1558,16 @@  ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
 	 */
 	if (!ieee80211_hw_check(&sta->local->hw, AP_LINK_PS) &&
 	    !ieee80211_has_morefrags(hdr->frame_control) &&
+	    !ieee80211_is_back_req(hdr->frame_control) &&
 	    !(status->rx_flags & IEEE80211_RX_DEFERRED_RELEASE) &&
 	    (rx->sdata->vif.type == NL80211_IFTYPE_AP ||
 	     rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&
-	    /* PM bit is only checked in frames where it isn't reserved,
+	    /*
+	     * PM bit is only checked in frames where it isn't reserved,
 	     * in AP mode it's reserved in non-bufferable management frames
 	     * (cf. IEEE 802.11-2012 8.2.4.1.7 Power Management field)
+	     * BAR frames should be ignored as specified in
+	     * IEEE 802.11-2012 10.2.1.2.
 	     */
 	    (!ieee80211_is_mgmt(hdr->frame_control) ||
 	     ieee80211_is_bufferable_mmpdu(hdr->frame_control))) {