Skip to content

Commit b95d2cc

Browse files
committed
mac80211: set IEEE80211_TX_CTRL_PORT_CTRL_PROTO for nl80211 TX
When a frame is transmitted via the nl80211 TX rather than as a normal frame, IEEE80211_TX_CTRL_PORT_CTRL_PROTO wasn't set and this will lead to wrong decisions (rate control etc.) being made about the frame; fix this. Fixes: 9118064 ("mac80211: Add support for tx_control_port") Signed-off-by: Johannes Berg <[email protected]> Link: https://lore.kernel.org/r/20200326155333.f183f52b02f0.I4054e2a8c11c2ddcb795a0103c87be3538690243@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent b16798f commit b95d2cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

net/mac80211/tx.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Copyright 2006-2007 Jiri Benc <[email protected]>
66
* Copyright 2007 Johannes Berg <[email protected]>
77
* Copyright 2013-2014 Intel Mobile Communications GmbH
8-
* Copyright (C) 2018 Intel Corporation
8+
* Copyright (C) 2018, 2020 Intel Corporation
99
*
1010
* Transmit and frame generation functions.
1111
*/
@@ -5149,6 +5149,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
51495149
struct ieee80211_local *local = sdata->local;
51505150
struct sk_buff *skb;
51515151
struct ethhdr *ehdr;
5152+
u32 ctrl_flags = 0;
51525153
u32 flags;
51535154

51545155
/* Only accept CONTROL_PORT_PROTOCOL configured in CONNECT/ASSOCIATE
@@ -5158,6 +5159,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
51585159
proto != cpu_to_be16(ETH_P_PREAUTH))
51595160
return -EINVAL;
51605161

5162+
if (proto == sdata->control_port_protocol)
5163+
ctrl_flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO;
5164+
51615165
if (unencrypted)
51625166
flags = IEEE80211_TX_INTFL_DONT_ENCRYPT;
51635167
else
@@ -5183,7 +5187,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
51835187
skb_reset_mac_header(skb);
51845188

51855189
local_bh_disable();
5186-
__ieee80211_subif_start_xmit(skb, skb->dev, flags, 0);
5190+
__ieee80211_subif_start_xmit(skb, skb->dev, flags, ctrl_flags);
51875191
local_bh_enable();
51885192

51895193
return 0;

0 commit comments

Comments
 (0)