diff options
author | monthadar <monthadar@FreeBSD.org> | 2013-02-07 21:27:40 +0000 |
---|---|---|
committer | monthadar <monthadar@FreeBSD.org> | 2013-02-07 21:27:40 +0000 |
commit | 989940d9efd2129ce37cfa645159588759926c15 (patch) | |
tree | 506db81fad4f2c548f0c389e58d632ad636c58b8 /sys/net80211/ieee80211_hwmp.c | |
parent | f3631fce3f3e16db66e87041ac6b159a0fe005e0 (diff) | |
download | FreeBSD-src-989940d9efd2129ce37cfa645159588759926c15.zip FreeBSD-src-989940d9efd2129ce37cfa645159588759926c15.tar.gz |
Mesh HWMP PREQ update: proxy reply only if mesh STA is a meshgate.
* Original PREP frame is transmitted only by the target mesh STA or the
mesh STA that is the proxy target;
* Fixed so that metric value is not over written incorrectly in
hwmp_recv_preq for when replying back with a PREP;
Approved by: adrian (mentor)
Diffstat (limited to 'sys/net80211/ieee80211_hwmp.c')
-rw-r--r-- | sys/net80211/ieee80211_hwmp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 50e4a1e..8f1a102 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -1017,10 +1017,12 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni, /* * Check if the PREQ is addressed to us. - * or a Proxy currently supplied by us. + * or a Proxy currently gated by us. */ if (IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0)) || - (rttarg != NULL && + (ms->ms_flags & IEEE80211_MESHFLAGS_GATE && + rttarg != NULL && + IEEE80211_ADDR_EQ(vap->iv_myaddr, rttarg->rt_mesh_gate) && rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY && rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { /* @@ -1031,6 +1033,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni, prep.prep_flags = 0; prep.prep_hopcount = 0; + prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; 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) { @@ -1042,6 +1045,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni, /* update proxy seqno to HWMP seqno */ rttarg->rt_ext_seq = hs->hs_seq; prep.prep_hopcount = rttarg->rt_nhops; + prep.prep_metric = rttarg->rt_metric; IEEE80211_ADDR_COPY(prep.prep_targetaddr, rttarg->rt_mesh_gate); } /* @@ -1050,7 +1054,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni, prep.prep_ttl = ms->ms_ttl; prep.prep_targetseq = hs->hs_seq; prep.prep_lifetime = preq->preq_lifetime; - prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; IEEE80211_ADDR_COPY(prep.prep_origaddr, preq->preq_origaddr); prep.prep_origseq = preq->preq_origseq; |