blob: c60a88d2a6532ded8ec930f82cd8614c85f8d9a1 [file] [log] [blame]
developere0a1e0e2023-02-24 11:26:12 +08001From: Felix Fietkau <nbd@nbd.name>
2Date: Wed, 15 Feb 2023 15:11:54 +0100
3Subject: [PATCH] wifi: mac80211: fix qos on mesh interfaces
4
5When ieee80211_select_queue is called for mesh, the sta pointer is usually
6NULL, since the nexthop is looked up much later in the tx path.
7Explicitly check for unicast address in that case in order to make qos work
8again.
9
10Fixes: 50e2ab392919 ("wifi: mac80211: fix queue selection for mesh/OCB interfaces")
11Signed-off-by: Felix Fietkau <nbd@nbd.name>
12---
13
14--- a/net/mac80211/wme.c
15+++ b/net/mac80211/wme.c
16@@ -147,6 +147,7 @@ u16 ieee80211_select_queue_80211(struct
17 u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
18 struct sta_info *sta, struct sk_buff *skb)
19 {
20+ const struct ethhdr *eth = (void *)skb->data;
21 struct mac80211_qos_map *qos_map;
22 bool qos;
23
24@@ -154,8 +155,9 @@ u16 ieee80211_select_queue(struct ieee80
25 skb_get_hash(skb);
26
27 /* all mesh/ocb stations are required to support WME */
28- if (sta && (sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
29- sdata->vif.type == NL80211_IFTYPE_OCB))
30+ if ((sdata->vif.type == NL80211_IFTYPE_MESH_POINT &&
31+ !is_multicast_ether_addr(eth->h_dest)) ||
32+ (sdata->vif.type == NL80211_IFTYPE_OCB && sta))
33 qos = true;
34 else if (sta)
35 qos = sta->sta.wme;