From owner-svn-src-head@FreeBSD.ORG Tue Jul 31 07:36:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09501106564A; Tue, 31 Jul 2012 07:36:28 +0000 (UTC) (envelope-from monthadar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E88008FC08; Tue, 31 Jul 2012 07:36:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6V7aRPw000940; Tue, 31 Jul 2012 07:36:27 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6V7aRVU000938; Tue, 31 Jul 2012 07:36:27 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201207310736.q6V7aRVU000938@svn.freebsd.org> From: Monthadar Al Jaberi Date: Tue, 31 Jul 2012 07:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238940 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2012 07:36:28 -0000 Author: monthadar Date: Tue Jul 31 07:36:27 2012 New Revision: 238940 URL: http://svn.freebsd.org/changeset/base/238940 Log: Fix a PREQ comparison error in 11s HWMP. * Earlier we compared two not equal metrics, one was what we recevied in the 'new PREQ' while the other was what we already have saved which was 'old PREQ' + link metric for the last hop; * Fixed by adding 'new PREQ' + link metric for the last hop in a temporary variable; Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Tue Jul 31 07:31:47 2012 (r238939) +++ head/sys/net80211/ieee80211_hwmp.c Tue Jul 31 07:36:27 2012 (r238940) @@ -912,6 +912,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_hwmp_state *hs = vap->iv_hwmp; struct ieee80211_meshprep_ie prep; ieee80211_hwmp_seq preqid; /* last seen preqid for orig */ + uint32_t metric = 0; if (ni == vap->iv_bss || ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) @@ -985,13 +986,13 @@ hwmp_recv_preq(struct ieee80211vap *vap, /* Data creation and update of forwarding information * according to Table 11C-8 for originator mesh STA. */ + metric = preq->preq_metric + ms->ms_pmetric->mpm_metric(ni); if (HWMP_SEQ_GT(preq->preq_origseq, hrorig->hr_seq) || (HWMP_SEQ_EQ(preq->preq_origseq, hrorig->hr_seq) && - preq->preq_metric < rtorig->rt_metric)) { + metric < rtorig->rt_metric)) { hrorig->hr_seq = preq->preq_origseq; IEEE80211_ADDR_COPY(rtorig->rt_nexthop, wh->i_addr2); - rtorig->rt_metric = preq->preq_metric + - ms->ms_pmetric->mpm_metric(ni); + rtorig->rt_metric = metric; rtorig->rt_nhops = preq->preq_hopcount + 1; ieee80211_mesh_rt_update(rtorig, preq->preq_lifetime); /* path to orig is valid now */