From owner-svn-src-all@FreeBSD.ORG Tue Jul 31 07:31:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7817106564A; Tue, 31 Jul 2012 07:31:48 +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 78F138FC12; Tue, 31 Jul 2012 07:31:48 +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 q6V7VmXn000533; Tue, 31 Jul 2012 07:31:48 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6V7VmnE000531; Tue, 31 Jul 2012 07:31:48 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201207310731.q6V7VmnE000531@svn.freebsd.org> From: Monthadar Al Jaberi Date: Tue, 31 Jul 2012 07:31:48 +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: r238939 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2012 07:31:48 -0000 Author: monthadar Date: Tue Jul 31 07:31:47 2012 New Revision: 238939 URL: http://svn.freebsd.org/changeset/base/238939 Log: Fix bugs in net80211s found with wtap simulator. For description of the test scripts refer to projects/net80211_testsuite/wtap. * Test 007 showed a bug in intermediate PREP for a proxy entry. Resolved; * Test 002 showed a bug in the Addressing Mode flag for a PREQ. Resolved; Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Tue Jul 31 07:22:50 2012 (r238938) +++ head/sys/net80211/ieee80211_hwmp.c Tue Jul 31 07:31:47 2012 (r238939) @@ -840,7 +840,7 @@ hwmp_rootmode_cb(void *arg) IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss, "%s", "send broadcast PREQ"); - preq.preq_flags = IEEE80211_MESHPREQ_FLAGS_AM; + preq.preq_flags = 0; if (ms->ms_flags & IEEE80211_MESHFLAGS_GATE) preq.preq_flags |= IEEE80211_MESHPREQ_FLAGS_GATE; if (hs->hs_rootmode == IEEE80211_HWMP_ROOTMODE_PROACTIVE) @@ -951,7 +951,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, hrtarg = IEEE80211_MESH_ROUTE_PRIV(rttarg, struct ieee80211_hwmp_route); /* Address mode: ucast */ - if((preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AM) == 0 && + if(preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AM && rttarg == NULL && !IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0))) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_HWMP, @@ -1029,6 +1029,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, hs->hs_seq = HWMP_SEQ_MAX(hs->hs_seq, PREQ_TSEQ(0)) + 1; prep.prep_flags = 0; + prep.prep_hopcount = 0; + IEEE80211_ADDR_COPY(prep.prep_targetaddr, vap->iv_myaddr); if (rttarg != NULL && /* if NULL it means we are the target */ rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, @@ -1038,13 +1040,13 @@ hwmp_recv_preq(struct ieee80211vap *vap, rttarg->rt_dest); /* update proxy seqno to HWMP seqno */ rttarg->rt_ext_seq = hs->hs_seq; + prep.prep_hopcount = rttarg->rt_nhops; + IEEE80211_ADDR_COPY(prep.prep_targetaddr, rttarg->rt_mesh_gate); } /* * Build and send a PREP frame. */ - prep.prep_hopcount = 0; prep.prep_ttl = ms->ms_ttl; - IEEE80211_ADDR_COPY(prep.prep_targetaddr, vap->iv_myaddr); prep.prep_targetseq = hs->hs_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL;