1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sun, 26 Mar 2023 17:11:34 +0200
3 Subject: [PATCH] wifi: mac80211: fix receiving mesh packets in forwarding=0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 When forwarding is set to 0, frames are typically sent with ttl=1.
10 Move the ttl decrement check below the check for local receive in order to
13 Reported-by: Thomas Hühn <thomas.huehn@hs-nordhausen.de>
14 Reported-by: Nick Hainke <vincent@systemli.org>
15 Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
16 Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 --- a/net/mac80211/rx.c
20 +++ b/net/mac80211/rx.c
21 @@ -2828,14 +2828,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
22 if (sdata->crypto_tx_tailroom_needed_cnt)
23 tailroom = IEEE80211_ENCRYPT_TAILROOM;
25 - if (!--mesh_hdr->ttl) {
29 - IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
30 - return RX_DROP_MONITOR;
33 if (mesh_hdr->flags & MESH_FLAGS_AE) {
34 struct mesh_path *mppath;
36 @@ -2874,6 +2866,14 @@ ieee80211_rx_mesh_data(struct ieee80211_
37 if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
40 + if (!--mesh_hdr->ttl) {
44 + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
45 + return RX_DROP_MONITOR;
48 if (!ifmsh->mshcfg.dot11MeshForwarding) {
49 if (is_multicast_ether_addr(eth->h_dest))