Commit 73b9f68a authored by Johannes Berg's avatar Johannes Berg Committed by Greg Kroah-Hartman

mac80211: set IEEE80211_TX_CTRL_PORT_CTRL_PROTO for nl80211 TX

[ Upstream commit b95d2ccd ]

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: 91180649 ("mac80211: Add support for tx_control_port")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20200326155333.f183f52b02f0.I4054e2a8c11c2ddcb795a0103c87be3538690243@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 86d79d34
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
* Copyright 2007 Johannes Berg <johannes@sipsolutions.net> * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright (C) 2018 Intel Corporation * Copyright (C) 2018, 2020 Intel Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -4840,6 +4840,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, ...@@ -4840,6 +4840,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct sk_buff *skb; struct sk_buff *skb;
struct ethhdr *ehdr; struct ethhdr *ehdr;
u32 ctrl_flags = 0;
u32 flags; u32 flags;
/* Only accept CONTROL_PORT_PROTOCOL configured in CONNECT/ASSOCIATE /* Only accept CONTROL_PORT_PROTOCOL configured in CONNECT/ASSOCIATE
...@@ -4849,6 +4850,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, ...@@ -4849,6 +4850,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
proto != cpu_to_be16(ETH_P_PREAUTH)) proto != cpu_to_be16(ETH_P_PREAUTH))
return -EINVAL; return -EINVAL;
if (proto == sdata->control_port_protocol)
ctrl_flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO;
if (unencrypted) if (unencrypted)
flags = IEEE80211_TX_INTFL_DONT_ENCRYPT; flags = IEEE80211_TX_INTFL_DONT_ENCRYPT;
else else
...@@ -4874,7 +4878,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, ...@@ -4874,7 +4878,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
local_bh_disable(); local_bh_disable();
__ieee80211_subif_start_xmit(skb, skb->dev, flags, 0); __ieee80211_subif_start_xmit(skb, skb->dev, flags, ctrl_flags);
local_bh_enable(); local_bh_enable();
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment