From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-by2nam01on0130.outbound.protection.outlook.com ([104.47.34.130]:30464 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387735AbeIXUwP (ORCPT ); Mon, 24 Sep 2018 16:52:15 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Yuan-Chi Pang , Johannes Berg , Sasha Levin Subject: [PATCH AUTOSEL 4.14 09/36] mac80211: mesh: fix HWMP sequence numbering to follow standard Date: Mon, 24 Sep 2018 14:48:58 +0000 Message-ID: <20180924144851.164533-9-alexander.levin@microsoft.com> References: <20180924144851.164533-1-alexander.levin@microsoft.com> In-Reply-To: <20180924144851.164533-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Yuan-Chi Pang [ 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 Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mesh_hwmp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index d6d3f316de4c..055ea36ff27b 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_s= ub_if_data *sdata, forward =3D false; reply =3D true; target_metric =3D 0; + + if (SN_GT(target_sn, ifmsh->sn)) + ifmsh->sn =3D target_sn; + if (time_after(jiffies, ifmsh->last_sn_update + net_traversal_jiffies(sdata)) || time_before(jiffies, ifmsh->last_sn_update)) { --=20 2.17.1