312-v6.3-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch 950 B

12345678910111213141516171819202122232425
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Date: Fri, 2 Dec 2022 13:53:11 +0100
  3. Subject: [PATCH] wifi: cfg80211: move A-MSDU check in
  4. ieee80211_data_to_8023_exthdr
  5. When parsing the outer A-MSDU header, don't check for inner bridge tunnel
  6. or RFC1042 headers. This is handled by ieee80211_amsdu_to_8023s already.
  7. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  8. ---
  9. --- a/net/wireless/util.c
  10. +++ b/net/wireless/util.c
  11. @@ -631,8 +631,9 @@ int ieee80211_data_to_8023_exthdr(struct
  12. break;
  13. }
  14. - if (likely(skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
  15. - ((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) &&
  16. + if (likely(!is_amsdu &&
  17. + skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
  18. + ((ether_addr_equal(payload.hdr, rfc1042_header) &&
  19. payload.proto != htons(ETH_P_AARP) &&
  20. payload.proto != htons(ETH_P_IPX)) ||
  21. ether_addr_equal(payload.hdr, bridge_tunnel_header)))) {