Commit 79448960e3d701f498accd3aa493c5e0851c639c

Authored by Yuan-Chi Pang
Committed by Greg Kroah-Hartman
1 parent 34bec4daf8

mac80211: mesh: fix HWMP sequence numbering to follow standard

[ Upstream commit 1f631c3201fe5491808df143d8fcba81b3197ffd ]

IEEE 802.11-2016 14.10.8.3 HWMP sequence numbering says:
If it is a target mesh STA, it shall update its own HWMP SN to
maximum (current HWMP SN, target HWMP SN in the PREQ element) + 1
immediately before it generates a PREP element in response to a
PREQ element.

Signed-off-by: Yuan-Chi Pang <fu3mo6goo@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

net/mac80211/mesh_hwmp.c
... ... @@ -572,6 +572,10 @@
572 572 forward = false;
573 573 reply = true;
574 574 target_metric = 0;
  575 +
  576 + if (SN_GT(target_sn, ifmsh->sn))
  577 + ifmsh->sn = target_sn;
  578 +
575 579 if (time_after(jiffies, ifmsh->last_sn_update +
576 580 net_traversal_jiffies(sdata)) ||
577 581 time_before(jiffies, ifmsh->last_sn_update)) {