383-mac80211-mesh-fix-HWMP-sequence-numbering-to-follow-.patch 932 B

12345678910111213141516171819202122232425262728
  1. From: Yuan-Chi Pang <[email protected]>
  2. Date: Wed, 29 Aug 2018 09:30:08 +0800
  3. Subject: [PATCH] mac80211: mesh: fix HWMP sequence numbering to follow
  4. standard
  5. IEEE 802.11-2016 14.10.8.3 HWMP sequence numbering says:
  6. If it is a target mesh STA, it shall update its own HWMP SN to
  7. maximum (current HWMP SN, target HWMP SN in the PREQ element) + 1
  8. immediately before it generates a PREP element in response to a
  9. PREQ element.
  10. Signed-off-by: Yuan-Chi Pang <[email protected]>
  11. Signed-off-by: Johannes Berg <[email protected]>
  12. ---
  13. --- a/net/mac80211/mesh_hwmp.c
  14. +++ b/net/mac80211/mesh_hwmp.c
  15. @@ -572,6 +572,10 @@ static void hwmp_preq_frame_process(stru
  16. forward = false;
  17. reply = true;
  18. target_metric = 0;
  19. +
  20. + if (SN_GT(target_sn, ifmsh->sn))
  21. + ifmsh->sn = target_sn;
  22. +
  23. if (time_after(jiffies, ifmsh->last_sn_update +
  24. net_traversal_jiffies(sdata)) ||
  25. time_before(jiffies, ifmsh->last_sn_update)) {