diff options
author | monthadar <monthadar@FreeBSD.org> | 2012-07-31 07:31:47 +0000 |
---|---|---|
committer | monthadar <monthadar@FreeBSD.org> | 2012-07-31 07:31:47 +0000 |
commit | c2d63929b4d15f46059d3e3aba0ccd0861217eb1 (patch) | |
tree | 27b6095802b9167b3c4a3294b3b97b5cd831777e /sys/net80211/ieee80211_hwmp.c | |
parent | 3e4ae46ebb3b2ac38170d6efa2e98605dbf3924d (diff) | |
download | FreeBSD-src-c2d63929b4d15f46059d3e3aba0ccd0861217eb1.zip FreeBSD-src-c2d63929b4d15f46059d3e3aba0ccd0861217eb1.tar.gz |
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;
Diffstat (limited to 'sys/net80211/ieee80211_hwmp.c')
-rw-r--r-- | sys/net80211/ieee80211_hwmp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 3a7b94f..f658156 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -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, struct ieee80211_node *ni, 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, struct ieee80211_node *ni, 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, struct ieee80211_node *ni, 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; |