All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] mac80211: clarify TDLS Tx handling
@ 2014-06-11 14:18 Arik Nemtsov
  2014-06-11 14:18 ` [PATCH 02/10] mac80211: set auth flags after other station info Arik Nemtsov
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Arik Nemtsov @ 2014-06-11 14:18 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Arik Nemtsov

Rename the flags used in the Tx path and add an explanation for the
reasons to drop, send directly or through the AP.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/tx.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0a519a5..023c74d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1813,7 +1813,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
 	int nh_pos, h_pos;
 	struct sta_info *sta = NULL;
 	bool wme_sta = false, authorized = false, tdls_auth = false;
-	bool tdls_direct = false;
+	bool tdls_peer = false, tdls_setup_frame = false;
 	bool multicast;
 	u32 info_flags = 0;
 	u16 info_id = 0;
@@ -1955,34 +1955,35 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
 #endif
 	case NL80211_IFTYPE_STATION:
 		if (sdata->wdev.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) {
-			bool tdls_peer = false;
-
 			sta = sta_info_get(sdata, skb->data);
 			if (sta) {
 				authorized = test_sta_flag(sta,
 							WLAN_STA_AUTHORIZED);
 				wme_sta = test_sta_flag(sta, WLAN_STA_WME);
 				tdls_peer = test_sta_flag(sta,
-							 WLAN_STA_TDLS_PEER);
+							  WLAN_STA_TDLS_PEER);
 				tdls_auth = test_sta_flag(sta,
 						WLAN_STA_TDLS_PEER_AUTH);
 			}
 
-			/*
-			 * If the TDLS link is enabled, send everything
-			 * directly. Otherwise, allow TDLS setup frames
-			 * to be transmitted indirectly.
-			 */
-			tdls_direct = tdls_peer && (tdls_auth ||
-				 !(ethertype == ETH_P_TDLS && skb->len > 14 &&
-				   skb->data[14] == WLAN_TDLS_SNAP_RFTYPE));
+			if (tdls_peer)
+				tdls_setup_frame =
+					ethertype == ETH_P_TDLS &&
+					skb->len > 14 &&
+					skb->data[14] == WLAN_TDLS_SNAP_RFTYPE;
 		}
 
-		if (tdls_direct) {
-			/* link during setup - throw out frames to peer */
-			if (!tdls_auth)
-				goto fail_rcu;
+		/*
+		 * TDLS link during setup - throw out frames to peer. We allow
+		 * TDLS-setup frames to unauthorized peers for the special case
+		 * of a link teardown after a TDLS sta is removed due to being
+		 * unreachable.
+		 */
+		if (tdls_peer && !tdls_auth && !tdls_setup_frame)
+			goto fail_rcu;
 
+		/* send direct packets to authorized TDLS peers */
+		if (tdls_peer && tdls_auth) {
 			/* DA SA BSSID */
 			memcpy(hdr.addr1, skb->data, ETH_ALEN);
 			memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-06-29 18:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11 14:18 [PATCH 01/10] mac80211: clarify TDLS Tx handling Arik Nemtsov
2014-06-11 14:18 ` [PATCH 02/10] mac80211: set auth flags after other station info Arik Nemtsov
2014-06-11 14:18 ` [PATCH 03/10] mac80211: cleanup TDLS state during failed setup Arik Nemtsov
2014-06-11 14:18 ` [PATCH 04/10] cfg80211: pass TDLS initiator in tdls_mgmt operations Arik Nemtsov
2014-06-11 14:18 ` [PATCH 05/10] mac80211: use " Arik Nemtsov
2014-06-29 10:43   ` Jouni Malinen
2014-06-29 15:23     ` Arik Nemtsov
2014-06-29 18:08       ` Jouni Malinen
2014-06-11 14:18 ` [PATCH 06/10] mac80211: split tdls_mgmt function Arik Nemtsov
2014-06-11 14:18 ` [PATCH 07/10] mac80211: implement proper Tx path flushing for TDLS Arik Nemtsov
2014-06-11 14:18 ` [PATCH 08/10] mac80211: add API to request TDLS operation from userspace Arik Nemtsov
2014-06-11 14:18 ` [PATCH 09/10] mac80211: make sure TDLS peer STA exists during setup Arik Nemtsov
2014-06-11 14:18 ` [PATCH 10/10] mac80211: protect TDLS discovery session Arik Nemtsov
2014-06-23 12:29 ` [PATCH 01/10] mac80211: clarify TDLS Tx handling Johannes Berg
2014-06-23 12:31   ` Arik Nemtsov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.