From bb337ddac23544dd36f994aac28236dac6aa37ab Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 3 Nov 2013 21:50:48 +0200 Subject: [PATCH] DFS: Do not use cf1 to override freq for 20 MHz channels NL80211_ATTR_CENTER_FREQ1 is defined to be used for anything but 20 MHz bandwidth, so it could be unset for 20 MHz channels. Do not use it to override center frequency from NL80211_ATTR_WIPHY_FREQ (if available) for 20 MHz channels to avoid clearing frequency. Signed-hostap: Jouni Malinen --- src/ap/dfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 2168941fe..0a909f4af 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -411,7 +411,8 @@ static int set_dfs_state(struct hostapd_iface *iface, int freq, int ht_enabled, case CHAN_WIDTH_20_NOHT: case CHAN_WIDTH_20: n_chans = 1; - frequency = cf1; + if (frequency == 0) + frequency = cf1; break; case CHAN_WIDTH_40: n_chans = 2; @@ -466,7 +467,8 @@ static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq, case CHAN_WIDTH_20_NOHT: case CHAN_WIDTH_20: radar_n_chans = 1; - frequency = cf1; + if (frequency == 0) + frequency = cf1; break; case CHAN_WIDTH_40: radar_n_chans = 2;