Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2019 13:17:03 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343342 - head/sys/net80211
Message-ID:  <201901231317.x0NDH3Tp068959@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Wed Jan 23 13:17:03 2019
New Revision: 343342
URL: https://svnweb.freebsd.org/changeset/base/343342

Log:
  net80211: turn channel mode check into assertion.
  
  There is may be only 11b channel (since chanflags[] table
  maps MODE_AUTO to the corresponding 11b channel flags).
  
  Checked with RTL8812AU, STA mode.
  
  MFC after:	5 days

Modified:
  head/sys/net80211/ieee80211_scan_sta.c

Modified: head/sys/net80211/ieee80211_scan_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_scan_sta.c	Wed Jan 23 13:07:05 2019	(r343341)
+++ head/sys/net80211/ieee80211_scan_sta.c	Wed Jan 23 13:17:03 2019	(r343342)
@@ -496,12 +496,15 @@ add_channels(struct ieee80211vap *vap,
 		if (c == NULL || isexcluded(vap, c))
 			continue;
 		if (mode == IEEE80211_MODE_AUTO) {
+			KASSERT(IEEE80211_IS_CHAN_B(c),
+			    ("%s: wrong channel for 'auto' mode %u / %u\n",
+			    __func__, c->ic_freq, c->ic_flags));
+
 			/*
 			 * XXX special-case 11b/g channels so we select
 			 *     the g channel if both are present.
 			 */
-			if (IEEE80211_IS_CHAN_B(c) &&
-			    (cg = find11gchannel(ic, i, c->ic_freq)) != NULL)
+			if ((cg = find11gchannel(ic, i, c->ic_freq)) != NULL)
 				c = cg;
 		}
 		ss->ss_chans[ss->ss_last++] = c;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901231317.x0NDH3Tp068959>