diff options
author | adrian <adrian@FreeBSD.org> | 2012-01-29 19:35:40 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-01-29 19:35:40 +0000 |
commit | f7ddc93af2b32ce497fcc0e75edee31c03bb2ed1 (patch) | |
tree | 1218b1a4cd23b754dfcd52aa0bd719fd3ab21a90 /sys/net80211/ieee80211_hwmp.c | |
parent | 6cfc6d189231e9644c03628aaa0865583d62839c (diff) | |
download | FreeBSD-src-f7ddc93af2b32ce497fcc0e75edee31c03bb2ed1.zip FreeBSD-src-f7ddc93af2b32ce497fcc0e75edee31c03bb2ed1.tar.gz |
Missing code for receiving MESH PREP that should be part of r230409.
Submitted by: <monthadar@gmail.com>
Diffstat (limited to 'sys/net80211/ieee80211_hwmp.c')
-rw-r--r-- | sys/net80211/ieee80211_hwmp.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 86d8e36..319c862 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -1044,12 +1044,21 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni, * Sequence number validation. */ hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq)) { - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREP from %6D, old seq no %u <= %u", - prep->prep_targetaddr, ":", - prep->prep_targetseq, hr->hr_seq); - return; + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { + if (HWMP_SEQ_LT(prep->prep_targetseq, hr->hr_seq)) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "discard PREP from %6D, old seq no %u < %u", + prep->prep_targetaddr, ":", + prep->prep_targetseq, hr->hr_seq); + return; + } else if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq) && + prep->prep_metric > rt->rt_metric) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "discard PREP from %6D, new metric %u > %u", + prep->prep_targetaddr, ":", + prep->prep_metric, rt->rt_metric); + return; + } } hr->hr_seq = prep->prep_targetseq; |