Skip to content

Commit

Permalink
wifi: mac80211: fix mesh path discovery based on unicast packets
Browse files Browse the repository at this point in the history
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: stable@vger.kernel.org
Fixes: 986e43b ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20230314095956.62085-3-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Felix Fietkau authored and Johannes Berg committed Mar 22, 2023
1 parent 4e348c6 commit f355f70
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2765,17 +2765,6 @@ ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta
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;
Expand Down Expand Up @@ -2814,6 +2803,17 @@ ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta
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]);

ieee80211_fill_mesh_addresses(&hdr, &hdr.frame_control,
Expand Down

0 comments on commit f355f70

Please sign in to comment.