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