aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-03-30 16:05:18 (GMT)
committerJouni Malinen <j@w1.fi>2013-03-30 16:05:18 (GMT)
commita5f61b2b87ceffec517e3baf531a466940dbd0b7 (patch)
treec0b1dff1d59f29eff64e85c5774555d0e8313fd4 /src
parent69554d78f6b8778c66ab688617225e62983c50fa (diff)
downloadhostap-a5f61b2b87ceffec517e3baf531a466940dbd0b7.zip
hostap-a5f61b2b87ceffec517e3baf531a466940dbd0b7.tar.gz
hostap-a5f61b2b87ceffec517e3baf531a466940dbd0b7.tar.bz2
Fix OLBC non-HT AP detection to check channel
A non-HT capable AP on any channel could have triggered us to enable protection regardless of own operating channel if the driver delivered Beacon frames from other channels. The channel detection in ap_list is not exactly ideal, but most cases can be handled by checking ap->channel against the currently configured channel (or secondary channel in case of HT40). Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/ap/ap_list.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ap/ap_list.c b/src/ap/ap_list.c
index 4260466..9f02151 100644
--- a/src/ap/ap_list.c
+++ b/src/ap/ap_list.c
@@ -200,6 +200,8 @@ void ap_list_process_beacon(struct hostapd_iface *iface,
if (elems->ds_params && elems->ds_params_len == 1)
ap->channel = elems->ds_params[0];
+ else if (elems->ht_operation && elems->ht_operation_len >= 1)
+ ap->channel = elems->ht_operation[0];
else if (fi)
ap->channel = fi->channel;
@@ -221,17 +223,23 @@ void ap_list_process_beacon(struct hostapd_iface *iface,
if (!iface->olbc &&
ap_list_beacon_olbc(iface, ap)) {
iface->olbc = 1;
- wpa_printf(MSG_DEBUG, "OLBC AP detected: " MACSTR " - enable "
- "protection", MAC2STR(ap->addr));
+ wpa_printf(MSG_DEBUG, "OLBC AP detected: " MACSTR
+ " (channel %d) - enable protection",
+ MAC2STR(ap->addr), ap->channel);
set_beacon++;
}
#ifdef CONFIG_IEEE80211N
- if (!iface->olbc_ht && !ap->ht_support) {
+ if (!iface->olbc_ht && !ap->ht_support &&
+ (ap->channel == 0 ||
+ ap->channel == iface->conf->channel ||
+ ap->channel == iface->conf->channel +
+ iface->conf->secondary_channel * 4)) {
iface->olbc_ht = 1;
hostapd_ht_operation_update(iface);
wpa_printf(MSG_DEBUG, "OLBC HT AP detected: " MACSTR
- " - enable protection", MAC2STR(ap->addr));
+ " (channel %d) - enable protection",
+ MAC2STR(ap->addr), ap->channel);
set_beacon++;
}
#endif /* CONFIG_IEEE80211N */