Skip to content

Commit f355f70

Browse files
nbd168jmberg-intel
authored andcommitted
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. Cc: [email protected] Fixes: 986e43b ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces") Signed-off-by: Felix Fietkau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 4e348c6 commit f355f70

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

net/mac80211/rx.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,17 +2765,6 @@ ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta
27652765
mesh_rmc_check(sdata, eth->h_source, mesh_hdr))
27662766
return RX_DROP_MONITOR;
27672767

2768-
/* Frame has reached destination. Don't forward */
2769-
if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
2770-
goto rx_accept;
2771-
2772-
if (!ifmsh->mshcfg.dot11MeshForwarding) {
2773-
if (is_multicast_ether_addr(eth->h_dest))
2774-
goto rx_accept;
2775-
2776-
return RX_DROP_MONITOR;
2777-
}
2778-
27792768
/* forward packet */
27802769
if (sdata->crypto_tx_tailroom_needed_cnt)
27812770
tailroom = IEEE80211_ENCRYPT_TAILROOM;
@@ -2814,6 +2803,17 @@ ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta
28142803
rcu_read_unlock();
28152804
}
28162805

2806+
/* Frame has reached destination. Don't forward */
2807+
if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
2808+
goto rx_accept;
2809+
2810+
if (!ifmsh->mshcfg.dot11MeshForwarding) {
2811+
if (is_multicast_ether_addr(eth->h_dest))
2812+
goto rx_accept;
2813+
2814+
return RX_DROP_MONITOR;
2815+
}
2816+
28172817
skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]);
28182818

28192819
ieee80211_fill_mesh_addresses(&hdr, &hdr.frame_control,

0 commit comments

Comments
 (0)