linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wil6210: disallow changing RSN in beacon change
@ 2017-10-17 19:42 Johannes Berg
  2017-10-18  9:25 ` Lior David
  2017-10-27 13:42 ` Kalle Valo
  0 siblings, 2 replies; 6+ messages in thread
From: Johannes Berg @ 2017-10-17 19:42 UTC (permalink / raw)
  To: linux-wireless; +Cc: Maya Erez, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This is a code path that will never really get hit anyway, since
it's nonsense to change the beacon of an existing BSS to suddenly
include or no longer include the RSN IE. Reject this instead of
having the dead code, and get rid of accessing wdev->ssid/_len by
way of that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 85d5c04618eb..a81711451691 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -1389,7 +1389,6 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
 				      struct cfg80211_beacon_data *bcon)
 {
 	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
-	int rc;
 	u32 privacy = 0;
 
 	wil_dbg_misc(wil, "change_beacon\n");
@@ -1400,24 +1399,11 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
 			     bcon->tail_len))
 		privacy = 1;
 
-	/* in case privacy has changed, need to restart the AP */
-	if (wil->privacy != privacy) {
-		struct wireless_dev *wdev = ndev->ieee80211_ptr;
-
-		wil_dbg_misc(wil, "privacy changed %d=>%d. Restarting AP\n",
-			     wil->privacy, privacy);
-
-		rc = _wil_cfg80211_start_ap(wiphy, ndev, wdev->ssid,
-					    wdev->ssid_len, privacy,
-					    wdev->beacon_interval,
-					    wil->channel, bcon,
-					    wil->hidden_ssid,
-					    wil->pbss);
-	} else {
-		rc = _wil_cfg80211_set_ies(wiphy, bcon);
-	}
+	/* privacy (really RSN) shouldn't be changing */
+	if (wil->privacy != privacy)
+		return -EINVAL;
 
-	return rc;
+	return _wil_cfg80211_set_ies(wiphy, bcon);
 }
 
 static int wil_cfg80211_start_ap(struct wiphy *wiphy,
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-27 13:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17 19:42 [PATCH] wil6210: disallow changing RSN in beacon change Johannes Berg
2017-10-18  9:25 ` Lior David
2017-10-18 10:13   ` Johannes Berg
2017-10-19  6:07     ` Lior David
2017-10-27 13:42 ` Kalle Valo
2017-10-27 13:45   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).