summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-07-19 10:37:59 +0300
committerJohannes Berg <johannes.berg@intel.com>2022-07-22 15:28:14 +0300
commitdd820ed6336ad37c870ef2f11e34dcf1a8ff2aa1 (patch)
tree4d6dfe1e25dfc5433d42d0f029b57792325eb5f7 /net/mac80211
parent8876c67e6296b44c283cd748d4888788af3f7942 (diff)
downloadlinux-dd820ed6336ad37c870ef2f11e34dcf1a8ff2aa1.tar.xz
wifi: mac80211: return error from control port TX for drops
If the frame is going to be dropped anyway because ieee80211_lookup_ra_sta() returned an error (and even though it's a bit racy, it will likely continue to do so), return the error out instead of just silently dropping the frame. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tx.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f246b3d264ee..772108c2cc6b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -5712,6 +5712,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
struct ethhdr *ehdr;
u32 ctrl_flags = 0;
u32 flags = 0;
+ int err;
/* Only accept CONTROL_PORT_PROTOCOL configured in CONNECT/ASSOCIATE
* or Pre-Authentication
@@ -5772,14 +5773,18 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
* AF_PACKET
*/
rcu_read_lock();
+ err = ieee80211_lookup_ra_sta(sdata, skb, &sta);
+ if (err) {
+ rcu_read_unlock();
+ return err;
+ }
- if (ieee80211_lookup_ra_sta(sdata, skb, &sta) == 0 && !IS_ERR(sta)) {
+ if (!IS_ERR(sta)) {
u16 queue = __ieee80211_select_queue(sdata, sta, skb);
skb_set_queue_mapping(skb, queue);
skb_get_hash(skb);
}
-
rcu_read_unlock();
/* mutex lock is only needed for incrementing the cookie counter */