All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Ilan Peer <ilan.peer@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH v2 08/13] mac80211: Do not disconnect on invalid operating class
Date: Mon, 19 Feb 2018 14:48:42 +0200	[thread overview]
Message-ID: <20180219124847.27169-9-luca@coelho.fi> (raw)
In-Reply-To: <20180219124847.27169-1-luca@coelho.fi>

From: Ilan Peer <ilan.peer@intel.com>

Some APs include a non global operating class in their extended channel
switch information element. In such a case, as the operating class is not
known, mac80211 would decide to disconnect.

However the specification states that the operating class needs to be
taken from Annex E, but it does not specify from which table it should be
taken, so it is valid for an AP to use a non global operating class.

To avoid possibly unneeded disconnection, in such a case ignore the
operating class and assume that the current band is used, and if the
resulting channel and band configuration is invalid disconnect.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 net/mac80211/spectmgmt.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index ee0181778a42..029334835747 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -8,6 +8,7 @@
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
  * Copyright 2007-2008, Intel Corporation
  * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
+ * Copyright (C) 2018        Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -27,7 +28,7 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
 				 u32 sta_flags, u8 *bssid,
 				 struct ieee80211_csa_ie *csa_ie)
 {
-	enum nl80211_band new_band;
+	enum nl80211_band new_band = current_band;
 	int new_freq;
 	u8 new_chan_no;
 	struct ieee80211_channel *new_chan;
@@ -55,15 +56,13 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
 				elems->ext_chansw_ie->new_operating_class,
 				&new_band)) {
 			sdata_info(sdata,
-				   "cannot understand ECSA IE operating class %d, disconnecting\n",
+				   "cannot understand ECSA IE operating class, %d, ignoring\n",
 				   elems->ext_chansw_ie->new_operating_class);
-			return -EINVAL;
 		}
 		new_chan_no = elems->ext_chansw_ie->new_ch_num;
 		csa_ie->count = elems->ext_chansw_ie->count;
 		csa_ie->mode = elems->ext_chansw_ie->mode;
 	} else if (elems->ch_switch_ie) {
-		new_band = current_band;
 		new_chan_no = elems->ch_switch_ie->new_ch_num;
 		csa_ie->count = elems->ch_switch_ie->count;
 		csa_ie->mode = elems->ch_switch_ie->mode;
-- 
2.15.1

  parent reply	other threads:[~2018-02-19 12:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 12:48 [PATCH v2 00/13] cfg80211/mac80211 patches from our internal tree 2018-02-16 Luca Coelho
2018-02-19 12:48 ` [PATCH v2 01/13] mac80211: fix a possible leak of station stats Luca Coelho
2018-02-19 12:48 ` [PATCH v2 02/13] mac80211: ibss: send a probe request instead of allocating station Luca Coelho
2018-02-19 12:56   ` Luca Coelho
2018-02-19 12:48 ` [PATCH v2 03/13] mac80211: fix calling sleeping function in atomic context Luca Coelho
2018-02-19 12:48 ` [PATCH v2 04/13] cfg80211: clear wep keys after disconnection Luca Coelho
2018-02-19 12:48 ` [PATCH v2 05/13] mac80211: support reporting A-MPDU EOF bit value/known Luca Coelho
2018-02-19 12:48 ` [PATCH v2 06/13] mac80211: add get TID helper Luca Coelho
2018-02-19 12:48 ` [PATCH v2 07/13] mac80211: Call mgd_prep_tx before transmitting deauthentication Luca Coelho
2018-02-19 12:48 ` Luca Coelho [this message]
2018-02-19 12:48 ` [PATCH v2 09/13] mac80211: Fix sending ADDBA response for an ongoing session Luca Coelho
2018-02-19 12:48 ` [PATCH v2 10/13] mac80211: agg-rx: Accept ADDBA request update if timeout did not change Luca Coelho
2018-02-19 12:48 ` [PATCH v2 11/13] cfg80211: read wmm rules from regulatory database Luca Coelho
2018-02-19 13:30   ` Johannes Berg
2018-02-27 22:19     ` Seth Forshee
2018-02-28  8:06       ` Johannes Berg
2018-02-19 12:48 ` [PATCH v2 12/13] mac80211: limit wmm params to comply with ETSI requirements Luca Coelho
2018-02-19 12:48 ` [PATCH v2 13/13] cfg80211: Add API to allow querying regdb for wmm_rule Luca Coelho
2018-02-27 10:39   ` Johannes Berg
2018-02-27 11:38     ` Luca Coelho

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=20180219124847.27169-9-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=ilan.peer@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.