From: Yuan-Chi Pang Date: Wed, 29 Aug 2018 01:30:08 +0000 (+0800) Subject: mac80211: mesh: fix HWMP sequence numbering to follow standard X-Git-Tag: v4.19~241^2~4^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f631c3201fe5491808df143d8fcba81b3197ffd;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 35ad398..daf9db3 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)) {