322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From: Felix Fietkau <[email protected]>
  2. Date: Sun, 26 Feb 2023 20:30:20 +0100
  3. Subject: [PATCH] wifi: mac80211: fix mesh path discovery based on unicast
  4. packets
  5. If a packet has reached its intended destination, it was bumped to the code
  6. that accepts it, without first checking if a mesh_path needs to be created
  7. based on the discovered source.
  8. Fix this by moving the destination address check further down
  9. Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
  10. Signed-off-by: Felix Fietkau <[email protected]>
  11. ---
  12. --- a/net/mac80211/rx.c
  13. +++ b/net/mac80211/rx.c
  14. @@ -2824,17 +2824,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
  15. mesh_rmc_check(sdata, eth->h_source, mesh_hdr))
  16. return RX_DROP_MONITOR;
  17. - /* Frame has reached destination. Don't forward */
  18. - if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
  19. - goto rx_accept;
  20. -
  21. - if (!ifmsh->mshcfg.dot11MeshForwarding) {
  22. - if (is_multicast_ether_addr(eth->h_dest))
  23. - goto rx_accept;
  24. -
  25. - return RX_DROP_MONITOR;
  26. - }
  27. -
  28. /* forward packet */
  29. if (sdata->crypto_tx_tailroom_needed_cnt)
  30. tailroom = IEEE80211_ENCRYPT_TAILROOM;
  31. @@ -2881,6 +2870,17 @@ ieee80211_rx_mesh_data(struct ieee80211_
  32. rcu_read_unlock();
  33. }
  34. + /* Frame has reached destination. Don't forward */
  35. + if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
  36. + goto rx_accept;
  37. +
  38. + if (!ifmsh->mshcfg.dot11MeshForwarding) {
  39. + if (is_multicast_ether_addr(eth->h_dest))
  40. + goto rx_accept;
  41. +
  42. + return RX_DROP_MONITOR;
  43. + }
  44. +
  45. skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]);
  46. if (!multicast &&