Skip to content

Commit

Permalink
mac80211: make sure TDLS peer STA exists during setup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arik Nemtsov authored and Johannes Berg committed Jun 23, 2014
1 parent c887f0d commit 7adc3e4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions net/mac80211/tdls.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,19 @@ ieee80211_tdls_mgmt_setup(struct wiphy *wiphy, struct net_device *dev,
goto exit;
}

/*
* make sure we have a STA representing the peer so we drop or buffer
* non-TDLS-setup frames to the peer. We can't send other packets
* during setup through the AP path
*/
rcu_read_lock();
if (!sta_info_get(sdata, peer)) {
rcu_read_unlock();
ret = -ENOLINK;
goto exit;
}
rcu_read_unlock();

ieee80211_flush_queues(local, sdata);

ret = ieee80211_tdls_prep_mgmt_packet(wiphy, dev, peer, action_code,
Expand Down

0 comments on commit 7adc3e4

Please sign in to comment.