]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mac80211: Fix don't use '>' operator for matching channel types
authorAshok Nagarajan <ashok@cozybit.com>
Tue, 8 May 2012 04:00:30 +0000 (21:00 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 17:24:25 +0000 (13:24 -0400)
Johannes pointed out that the use of > operators for checking channel type
mismatch maynot be correct way as we may add other channel types in future.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mesh.c

index 0a21e4e55f43bb3003682ae2ff0125365046155d..d3a9a6c081e7720d3621844cd1f19315aea5d761 100644 (file)
@@ -109,8 +109,10 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
 
        /* Disallow HT40+/- mismatch */
        if (ie->ht_operation &&
-           local->_oper_channel_type > NL80211_CHAN_HT20 &&
-           sta_channel_type > NL80211_CHAN_HT20 &&
+           (local->_oper_channel_type == NL80211_CHAN_HT40MINUS ||
+           local->_oper_channel_type == NL80211_CHAN_HT40PLUS) &&
+           (sta_channel_type == NL80211_CHAN_HT40MINUS ||
+            sta_channel_type == NL80211_CHAN_HT40PLUS) &&
            local->_oper_channel_type != sta_channel_type)
                goto mismatch;