diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-02-26 20:35:40 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-02-26 23:45:07 +0100 |
commit | 1272cb0a0dec0917f20adc79b8146e7ef19d3d95 (patch) | |
tree | cd0ee852d9e9e7a6fbf8090f41ee72584e1a5949 /package/kernel | |
parent | 2f96580c5282cd138d2bb858f7f27f539c8a63e1 (diff) | |
download | upstream-1272cb0a0dec0917f20adc79b8146e7ef19d3d95.tar.gz upstream-1272cb0a0dec0917f20adc79b8146e7ef19d3d95.tar.bz2 upstream-1272cb0a0dec0917f20adc79b8146e7ef19d3d95.zip |
mac80211: fix mesh path discovery based on unicast packets
If a packet has reached its intended destination, it was bumped to the code
that accepts it, without first checking if a mesh_path needs to be created
based on the discovered source.
Fix this by moving the destination address check further down
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel')
-rw-r--r-- | package/kernel/mac80211/patches/subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch b/package/kernel/mac80211/patches/subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch new file mode 100644 index 0000000000..292a89ef92 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch @@ -0,0 +1,52 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Sun, 26 Feb 2023 20:30:20 +0100 +Subject: [PATCH] wifi: mac80211: fix mesh path discovery based on unicast + packets + +If a packet has reached its intended destination, it was bumped to the code +that accepts it, without first checking if a mesh_path needs to be created +based on the discovered source. +Fix this by moving the destination address check further down + +Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces") +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2824,17 +2824,6 @@ ieee80211_rx_mesh_data(struct ieee80211_ + mesh_rmc_check(sdata, eth->h_source, mesh_hdr)) + return RX_DROP_MONITOR; + +- /* Frame has reached destination. Don't forward */ +- if (ether_addr_equal(sdata->vif.addr, eth->h_dest)) +- goto rx_accept; +- +- if (!ifmsh->mshcfg.dot11MeshForwarding) { +- if (is_multicast_ether_addr(eth->h_dest)) +- goto rx_accept; +- +- return RX_DROP_MONITOR; +- } +- + /* forward packet */ + if (sdata->crypto_tx_tailroom_needed_cnt) + tailroom = IEEE80211_ENCRYPT_TAILROOM; +@@ -2881,6 +2870,17 @@ ieee80211_rx_mesh_data(struct ieee80211_ + rcu_read_unlock(); + } + ++ /* Frame has reached destination. Don't forward */ ++ if (ether_addr_equal(sdata->vif.addr, eth->h_dest)) ++ goto rx_accept; ++ ++ if (!ifmsh->mshcfg.dot11MeshForwarding) { ++ if (is_multicast_ether_addr(eth->h_dest)) ++ goto rx_accept; ++ ++ return RX_DROP_MONITOR; ++ } ++ + skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]); + + if (!multicast && |