diff mbox series

[2/2] mac80211: remove ieee80211_tx_h_check_control_port_protocol()

Message ID 20200326155333.05f411833f60.Ibf3dccc8aea73ae868da352811e5f1a3aef72ee0@changeid
State New
Headers show
Series [1/2] mac80211: Check port authorization in the ieee80211_tx_dequeue() case | expand

Commit Message

Johannes Berg March 26, 2020, 2:53 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

This code is actually not ever effective, since the skb->protocol
isn't set up correctly (or at all) on outgoing frames. Also, we
already set the flags (except for IEEE80211_TX_CTL_USE_MINRATE)
in other code paths, and rate control already handles the frames
specially. Just remove it entirely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/tx.c | 16 ----------------
 1 file changed, 16 deletions(-)

Comments

Johannes Berg Jan. 18, 2023, 10:53 a.m. UTC | #1
On Thu, 2020-03-26 at 15:53 +0100, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> This code is actually not ever effective, since the skb->protocol
> isn't set up correctly (or at all) on outgoing frames. Also, we
> already set the flags (except for IEEE80211_TX_CTL_USE_MINRATE)
> in other code paths, and rate control already handles the frames
> specially. Just remove it entirely.
> 

Thread necromancy alert ...

But for my own information (and everyone else who cares):

This breaks a couple of hwsim test cases, for example
ap_wpa2_psk_no_control_port.

johannes
diff mbox series

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index bc1c27dc8dd5..5a37f7924af4 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -568,21 +568,6 @@  ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx)
 		return ieee80211_tx_h_multicast_ps_buf(tx);
 }
 
-static ieee80211_tx_result debug_noinline
-ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx)
-{
-	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
-
-	if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol)) {
-		if (tx->sdata->control_port_no_encrypt)
-			info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
-		info->control.flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO;
-		info->flags |= IEEE80211_TX_CTL_USE_MINRATE;
-	}
-
-	return TX_CONTINUE;
-}
-
 static ieee80211_tx_result debug_noinline
 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
 {
@@ -1775,7 +1760,6 @@  static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx)
 	CALL_TXH(ieee80211_tx_h_dynamic_ps);
 	CALL_TXH(ieee80211_tx_h_check_assoc);
 	CALL_TXH(ieee80211_tx_h_ps_buf);
-	CALL_TXH(ieee80211_tx_h_check_control_port_protocol);
 	CALL_TXH(ieee80211_tx_h_select_key);
 	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
 		CALL_TXH(ieee80211_tx_h_rate_ctrl);