Date: Tue, 31 Jul 2012 07:36:27 +0000 (UTC) From: Monthadar Al Jaberi <monthadar@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r238940 - head/sys/net80211 Message-ID: <201207310736.q6V7aRVU000938@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207310736.q6V7aRVU000938>