mac80211: fix receiving mesh packets in forwarding=0 networks
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 317-wifi-mac80211-fix-qos-on-mesh-interfaces.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 15 Feb 2023 15:11:54 +0100
3 Subject: [PATCH] wifi: mac80211: fix qos on mesh interfaces
4
5 When ieee80211_select_queue is called for mesh, the sta pointer is usually
6 NULL, since the nexthop is looked up much later in the tx path.
7 Explicitly check for unicast address in that case in order to make qos work
8 again.
9
10 Fixes: 50e2ab392919 ("wifi: mac80211: fix queue selection for mesh/OCB interfaces")
11 Signed-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;