aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-06-11 10:18:26 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-06-23 08:28:18 -0400
commit7adc3e4664bc5bd382fa181e6a4506f5b5b583d8 (patch)
tree7384beda7ccdab431af7d3fdfdb8003aab6b17ad
parentc887f0d3a03283cb6fe2c32aae62229bebd3fa32 (diff)
mac80211: make sure TDLS peer STA exists during setup
Make sure userspace added a TDLS peer station before invoking the transmission of the first setup frame. This ensures packets to the peer won't go through the AP path. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/tdls.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 6f3a3ad0cb7c..b87e369561f4 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -332,6 +332,19 @@ ieee80211_tdls_mgmt_setup(struct wiphy *wiphy, struct net_device *dev,
332 goto exit; 332 goto exit;
333 } 333 }
334 334
335 /*
336 * make sure we have a STA representing the peer so we drop or buffer
337 * non-TDLS-setup frames to the peer. We can't send other packets
338 * during setup through the AP path
339 */
340 rcu_read_lock();
341 if (!sta_info_get(sdata, peer)) {
342 rcu_read_unlock();
343 ret = -ENOLINK;
344 goto exit;
345 }
346 rcu_read_unlock();
347
335 ieee80211_flush_queues(local, sdata); 348 ieee80211_flush_queues(local, sdata);
336 349
337 ret = ieee80211_tdls_prep_mgmt_packet(wiphy, dev, peer, action_code, 350 ret = ieee80211_tdls_prep_mgmt_packet(wiphy, dev, peer, action_code,