388-mac80211-fix-an-off-by-one-issue-in-A-MSDU-max_subfr.patch 882 B

1234567891011121314151617181920212223242526
  1. From: Lorenzo Bianconi <[email protected]>
  2. Date: Fri, 31 Aug 2018 01:04:13 +0200
  3. Subject: [PATCH] mac80211: fix an off-by-one issue in A-MSDU
  4. max_subframe computation
  5. Initialize 'n' to 2 in order to take into account also the first
  6. packet in the estimation of max_subframe limit for a given A-MSDU
  7. since frag_tail pointer is NULL when ieee80211_amsdu_aggregate
  8. routine analyzes the second frame.
  9. Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
  10. Signed-off-by: Lorenzo Bianconi <[email protected]>
  11. Signed-off-by: Johannes Berg <[email protected]>
  12. ---
  13. --- a/net/mac80211/tx.c
  14. +++ b/net/mac80211/tx.c
  15. @@ -3166,7 +3166,7 @@ static bool ieee80211_amsdu_aggregate(st
  16. void *data;
  17. bool ret = false;
  18. unsigned int orig_len;
  19. - int n = 1, nfrags, pad = 0;
  20. + int n = 2, nfrags, pad = 0;
  21. u16 hdrlen;
  22. if (!ieee80211_hw_check(&local->hw, TX_AMSDU))