aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2014-01-29 11:53:43 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-04 15:58:16 -0500
commitfe94f3a4ffaa20c7470038c69ffc8e545ef5f90a (patch)
treea8056f9f9e74e30679bb4fc852dfe19bd680f51e /include
parent67235cbca44f082e9c4c2ed370f9afe5fc478d49 (diff)
cfg80211: fix channel configuration in IBSS join
When receiving an IBSS_JOINED event select the BSS object based on the {bssid, channel} couple rather than the bssid only. With the current approach if another cell having the same BSSID (but using a different channel) exists then cfg80211 picks up the wrong BSS object. The result is a mismatching channel configuration between cfg80211 and the driver, that can lead to any sort of problem. The issue can be triggered by having an IBSS sitting on given channel and then asking the driver to create a new cell using the same BSSID but with a different frequency. By passing the channel to cfg80211_get_bss() we can solve this ambiguity and retrieve/create the correct BSS object. All the users of cfg80211_ibss_joined() have been changed accordingly. Moreover WARN when cfg80211_ibss_joined() gets a NULL channel as argument and remove a bogus call of the same function in ath6kl (it does not make sense to call cfg80211_ibss_joined() with a zero BSSID on ibss-leave). Cc: Kalle Valo <kvalo@qca.qualcomm.com> Cc: Arend van Spriel <arend@broadcom.com> Cc: Bing Zhao <bzhao@marvell.com> Cc: Jussi Kivilinna <jussi.kivilinna@iki.fi> Cc: libertas-dev@lists.infradead.org Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> [minor code cleanup in ath6kl] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 009290e36d15..c68201d78b90 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3895,6 +3895,7 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
3895 * 3895 *
3896 * @dev: network device 3896 * @dev: network device
3897 * @bssid: the BSSID of the IBSS joined 3897 * @bssid: the BSSID of the IBSS joined
3898 * @channel: the channel of the IBSS joined
3898 * @gfp: allocation flags 3899 * @gfp: allocation flags
3899 * 3900 *
3900 * This function notifies cfg80211 that the device joined an IBSS or 3901 * This function notifies cfg80211 that the device joined an IBSS or
@@ -3904,7 +3905,8 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
3904 * with the locally generated beacon -- this guarantees that there is 3905 * with the locally generated beacon -- this guarantees that there is
3905 * always a scan result for this IBSS. cfg80211 will handle the rest. 3906 * always a scan result for this IBSS. cfg80211 will handle the rest.
3906 */ 3907 */
3907void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); 3908void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
3909 struct ieee80211_channel *channel, gfp_t gfp);
3908 3910
3909/** 3911/**
3910 * cfg80211_notify_new_candidate - notify cfg80211 of a new mesh peer candidate 3912 * cfg80211_notify_new_candidate - notify cfg80211 of a new mesh peer candidate