summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorYuan-Chi Pang <fu3mo6goo@gmail.com>2018-08-29 04:30:08 +0300
committerJohannes Berg <johannes.berg@intel.com>2018-08-29 12:15:30 +0300
commit1f631c3201fe5491808df143d8fcba81b3197ffd (patch)
treeebb2fa1f5e722471fd0ebfa2b9840ff8b6c53f01 /net
parentb88d26d97c41680f7327e5fb8061ad0037877f40 (diff)
downloadlinux-1f631c3201fe5491808df143d8fcba81b3197ffd.tar.xz
mac80211: mesh: fix HWMP sequence numbering to follow standard
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>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mesh_hwmp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 35ad3983ae4b..daf9db3c8f24 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -572,6 +572,10 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
forward = false;
reply = true;
target_metric = 0;
+
+ if (SN_GT(target_sn, ifmsh->sn))
+ ifmsh->sn = target_sn;
+
if (time_after(jiffies, ifmsh->last_sn_update +
net_traversal_jiffies(sdata)) ||
time_before(jiffies, ifmsh->last_sn_update)) {