aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2016-08-18 01:06:44 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-18 07:46:39 (GMT)
commitecba4509d94a50f8ecf26399d4cf2cb352549c9c (patch)
tree297c1cafc73258402787ce04aea6c1a59b1fd760 /wpa_supplicant
parent05aed438cd65ed2ab11856361f66f1f7d8896548 (diff)
downloadhostap-ecba4509d94a50f8ecf26399d4cf2cb352549c9c.zip
hostap-ecba4509d94a50f8ecf26399d4cf2cb352549c9c.tar.gz
hostap-ecba4509d94a50f8ecf26399d4cf2cb352549c9c.tar.bz2
mesh: Simplify HT40 check code
The ht40 variable can only have values -1 or 1 here, so need to try to address ht40 == 0 case. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpa_supplicant.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 0eee641..28fbdf2 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1930,22 +1930,16 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
freq->channel = pri_chan->chan;
- switch (ht40) {
- case -1:
+ if (ht40 == -1) {
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
return;
- freq->sec_channel_offset = -1;
- break;
- case 1:
+ } else {
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40PLUS))
return;
- freq->sec_channel_offset = 1;
- break;
- default:
- break;
}
+ freq->sec_channel_offset = ht40;
- if (freq->sec_channel_offset && obss_scan) {
+ if (obss_scan) {
struct wpa_scan_results *scan_res;
scan_res = wpa_supplicant_get_scan_results(wpa_s, NULL, 0);