From a78d3dbd02de9579f75158c10864b0f84969bf5b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 26 Nov 2008 10:52:45 +0200 Subject: [PATCH] nl80211: Fixed a merge issue in an earlier commit for set_freq --- hostapd/driver_nl80211.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/hostapd/driver_nl80211.c b/hostapd/driver_nl80211.c index 4f8d04983..8edb3a3dc 100644 --- a/hostapd/driver_nl80211.c +++ b/hostapd/driver_nl80211.c @@ -482,19 +482,21 @@ static int i802_set_freq2(void *priv, struct hostapd_freq_params *freq) NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(drv->iface)); NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq->freq); - switch (freq->sec_channel_offset) { - case -1: - NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, - NL80211_SEC_CHAN_BELOW); - break; - case 1: - NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, - NL80211_SEC_CHAN_ABOVE); - break; - default: - NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, - NL80211_SEC_CHAN_DISABLED); - break; + if (freq->ht_enabled) { + switch (freq->sec_channel_offset) { + case -1: + NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, + NL80211_SEC_CHAN_BELOW); + break; + case 1: + NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, + NL80211_SEC_CHAN_ABOVE); + break; + default: + NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, + NL80211_SEC_CHAN_DISABLED); + break; + } } if (send_and_recv_msgs(drv, msg, NULL, NULL) == 0)