public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Sujith <Sujith.Manoharan@atheros.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: Deny TX BA session requests during disassociation
Date: Wed, 10 Feb 2010 10:47:24 +0100	[thread overview]
Message-ID: <1265795244.4018.0.camel@johannes.berg> (raw)
In-Reply-To: <19314.31437.647232.84860@gargle.gargle.HOWL>

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

On Wed, 2010-02-10 at 14:52 +0530, Sujith wrote:
> In associated state, when bringing an interface down, existing
> BA sessions are torn down. When this is in progress, nothing
> prevents mac80211 from accepting another BA session start request.
> 
> Use a new station flag to fix this.

Good catch! Thanks.

Acked-by: Johannes Berg <johannes@sipsolutions.net>

johannes

> Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
> ---
>  net/mac80211/agg-tx.c   |    8 ++++++++
>  net/mac80211/mlme.c     |    4 +++-
>  net/mac80211/sta_info.h |    4 ++++
>  3 files changed, 15 insertions(+), 1 deletions(-)
> 
> diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
> index 718fbcf..5538e1b 100644
> --- a/net/mac80211/agg-tx.c
> +++ b/net/mac80211/agg-tx.c
> @@ -237,6 +237,14 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid)
>  	    sdata->vif.type != NL80211_IFTYPE_AP)
>  		return -EINVAL;
>  
> +	if (test_sta_flags(sta, WLAN_STA_DISASSOC)) {
> +#ifdef CONFIG_MAC80211_HT_DEBUG
> +		printk(KERN_DEBUG "Disassociation is in progress. "
> +		       "Denying BA session request\n");
> +#endif
> +		return -EINVAL;
> +	}
> +
>  	if (test_sta_flags(sta, WLAN_STA_SUSPEND)) {
>  #ifdef CONFIG_MAC80211_HT_DEBUG
>  		printk(KERN_DEBUG "Suspend in progress. "
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index ee9443d..bfc4a50 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -797,8 +797,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata)
>  
>  	rcu_read_lock();
>  	sta = sta_info_get(sdata, bssid);
> -	if (sta)
> +	if (sta) {
> +		set_sta_flags(sta, WLAN_STA_DISASSOC);
>  		ieee80211_sta_tear_down_BA_sessions(sta);
> +	}
>  	rcu_read_unlock();
>  
>  	changed |= ieee80211_reset_erp_info(sdata);
> diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
> index 5ff611a..822d845 100644
> --- a/net/mac80211/sta_info.h
> +++ b/net/mac80211/sta_info.h
> @@ -42,6 +42,9 @@
>   *	be in the queues
>   * @WLAN_STA_PSPOLL: Station sent PS-poll while driver was keeping
>   *	station in power-save mode, reply when the driver unblocks.
> + * @WLAN_STA_DISASSOC: Disassociation in progress.
> + *	This is used to reject TX BA session requests when disassociation
> + *	is in progress.
>   */
>  enum ieee80211_sta_info_flags {
>  	WLAN_STA_AUTH		= 1<<0,
> @@ -57,6 +60,7 @@ enum ieee80211_sta_info_flags {
>  	WLAN_STA_SUSPEND	= 1<<11,
>  	WLAN_STA_PS_DRIVER	= 1<<12,
>  	WLAN_STA_PSPOLL		= 1<<13,
> +	WLAN_STA_DISASSOC       = 1<<14,
>  };
>  
>  #define STA_TID_NUM 16


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

      reply	other threads:[~2010-02-10  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10  9:22 [PATCH] mac80211: Deny TX BA session requests during disassociation Sujith
2010-02-10  9:47 ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265795244.4018.0.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=Sujith.Manoharan@atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox