329-wifi-mac80211-fix-receiving-mesh-packets-in-forwardi.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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
  4. networks
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. When forwarding is set to 0, frames are typically sent with ttl=1.
  9. Move the ttl decrement check below the check for local receive in order to
  10. fix packet drops.
  11. Reported-by: Thomas Hühn <thomas.huehn@hs-nordhausen.de>
  12. Reported-by: Nick Hainke <vincent@systemli.org>
  13. Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
  14. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  15. ---
  16. --- a/net/mac80211/rx.c
  17. +++ b/net/mac80211/rx.c
  18. @@ -2828,14 +2828,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
  19. if (sdata->crypto_tx_tailroom_needed_cnt)
  20. tailroom = IEEE80211_ENCRYPT_TAILROOM;
  21. - if (!--mesh_hdr->ttl) {
  22. - if (multicast)
  23. - goto rx_accept;
  24. -
  25. - IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
  26. - return RX_DROP_MONITOR;
  27. - }
  28. -
  29. if (mesh_hdr->flags & MESH_FLAGS_AE) {
  30. struct mesh_path *mppath;
  31. char *proxied_addr;
  32. @@ -2874,6 +2866,14 @@ ieee80211_rx_mesh_data(struct ieee80211_
  33. if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
  34. goto rx_accept;
  35. + if (!--mesh_hdr->ttl) {
  36. + if (multicast)
  37. + goto rx_accept;
  38. +
  39. + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
  40. + return RX_DROP_MONITOR;
  41. + }
  42. +
  43. if (!ifmsh->mshcfg.dot11MeshForwarding) {
  44. if (is_multicast_ether_addr(eth->h_dest))
  45. goto rx_accept;