summary refs log tree commit diff
path: root/net/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2023-03-14 10:59:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-30 12:49:27 +0200
commitc5d24e07e316914021bfcf8822ebdb89b2cd1c1e (patch)
treeeaf228560851c39ab14110b31b9ebf1fbd6a7d4f /net/mac80211
parent0b3ec5671ac06829ccebdaeec05acedfec327f42 (diff)
downloadlinux-c5d24e07e316914021bfcf8822ebdb89b2cd1c1e.tar.gz
wifi: mac80211: fix qos on mesh interfaces
commit 4e348c6c6e23491ae6eb5e077848a42d0562339c upstream.

When ieee80211_select_queue is called for mesh, the sta pointer is usually
NULL, since the nexthop is looked up much later in the tx path.
Explicitly check for unicast address in that case in order to make qos work
again.

Cc: stable@vger.kernel.org
Fixes: 50e2ab392919 ("wifi: mac80211: fix queue selection for mesh/OCB interfaces")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20230314095956.62085-1-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/wme.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index ecc1de2e68a5..64430949f685 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -144,12 +144,14 @@ u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
 u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
 			     struct sta_info *sta, struct sk_buff *skb)
 {
+	const struct ethhdr *eth = (void *)skb->data;
 	struct mac80211_qos_map *qos_map;
 	bool qos;
 
 	/* all mesh/ocb stations are required to support WME */
-	if (sta && (sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
-		    sdata->vif.type == NL80211_IFTYPE_OCB))
+	if ((sdata->vif.type == NL80211_IFTYPE_MESH_POINT &&
+	    !is_multicast_ether_addr(eth->h_dest)) ||
+	    (sdata->vif.type == NL80211_IFTYPE_OCB && sta))
 		qos = true;
 	else if (sta)
 		qos = sta->sta.wme;