aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wnm_sta.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-11-24 08:57:38 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-24 08:57:38 (GMT)
commit158211b2db37df7d9a684e3de21ce5ee003c7d0b (patch)
tree16f157a56b85ef862b58359b0ced480b1a235c90 /wpa_supplicant/wnm_sta.c
parent649c0a697438ee3268268957b915e474a5c7f39b (diff)
downloadhostap-158211b2db37df7d9a684e3de21ce5ee003c7d0b.zip
hostap-158211b2db37df7d9a684e3de21ce5ee003c7d0b.tar.gz
hostap-158211b2db37df7d9a684e3de21ce5ee003c7d0b.tar.bz2
WNM: Use country code, if available, to help in channel mapping
The country code from the current AP needs to be used in ieee80211_chan_to_freq() to support cases where non-global operating class table is used. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wnm_sta.c')
-rw-r--r--wpa_supplicant/wnm_sta.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
index 424c634..38be02b 100644
--- a/wpa_supplicant/wnm_sta.c
+++ b/wpa_supplicant/wnm_sta.c
@@ -411,7 +411,17 @@ static void wnm_parse_neighbor_report_elem(struct neighbor_report *rep,
static int wnm_nei_get_chan(struct wpa_supplicant *wpa_s, u8 op_class, u8 chan)
{
- return ieee80211_chan_to_freq(NULL, op_class, chan);
+ struct wpa_bss *bss = wpa_s->current_bss;
+ const char *country = NULL;
+
+ if (bss) {
+ const u8 *elem = wpa_bss_get_ie(bss, WLAN_EID_COUNTRY);
+
+ if (elem && elem[1] >= 2)
+ country = (const char *) (elem + 2);
+ }
+
+ return ieee80211_chan_to_freq(country, op_class, chan);
}