summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_scan_sta.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2008-12-15 01:26:33 +0000
committersam <sam@FreeBSD.org>2008-12-15 01:26:33 +0000
commitdc256886cd00e7367a087d21fe06be26030d80e0 (patch)
treec93f57c8693451ef5985e24651f8da4d8456781a /sys/net80211/ieee80211_scan_sta.c
parent3ec60cf583778dfd58f3aef1e866bb688c51c04d (diff)
downloadFreeBSD-src-dc256886cd00e7367a087d21fe06be26030d80e0.zip
FreeBSD-src-dc256886cd00e7367a087d21fe06be26030d80e0.tar.gz
Fix definition of IEEE80211_CHAN_MAX; it was defined as 255 but
really was meant to be 256. Adjust usage accordingly and replace bogus usage of this value in checking IEEE channel #'s. NB: this causes an ABI change; ifconfig must be recompiled
Diffstat (limited to 'sys/net80211/ieee80211_scan_sta.c')
-rw-r--r--sys/net80211/ieee80211_scan_sta.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
index e3a4bda..f722d6b 100644
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -87,6 +87,9 @@ struct sta_entry {
#define STA_HASH(addr) \
(((const uint8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % STA_HASHSIZE)
+#define MAX_IEEE_CHAN 256 /* max acceptable IEEE chan # */
+CTASSERT(MAX_IEEE_CHAN >= 256);
+
struct sta_table {
struct mtx st_lock; /* on scan table */
TAILQ_HEAD(, sta_entry) st_entry; /* all entries */
@@ -96,7 +99,7 @@ struct sta_table {
u_int st_scangen; /* scan generation # */
int st_newscan;
/* ap-related state */
- int st_maxrssi[IEEE80211_CHAN_MAX];
+ int st_maxrssi[MAX_IEEE_CHAN];
};
static void sta_flush_table(struct sta_table *);
@@ -343,6 +346,7 @@ found:
se->se_seen = 1;
se->se_notseen = 0;
+ KASSERT(sizeof(sp->bchan) == 1, ("bchan size"));
if (rssi > st->st_maxrssi[sp->bchan])
st->st_maxrssi[sp->bchan] = rssi;
@@ -1604,6 +1608,7 @@ ap_pick_channel(struct ieee80211_scan_state *ss, int flags)
/* check channel attributes for band compatibility */
if (flags != 0 && (chan->ic_flags & flags) != flags)
continue;
+ KASSERT(sizeof(chan->ic_ieee) == 1, ("ic_chan size"));
/* XXX channel have interference */
if (st->st_maxrssi[chan->ic_ieee] == 0) {
/* XXX use other considerations */
OpenPOWER on IntegriCloud