svn commit: r230752 - head/sys/net80211
Adrian Chadd
adrian at FreeBSD.org
Sun Jan 29 19:35:40 UTC 2012
Author: adrian
Date: Sun Jan 29 19:35:40 2012
New Revision: 230752
URL: http://svn.freebsd.org/changeset/base/230752
Log:
Missing code for receiving MESH PREP that should be part of r230409.
Submitted by: <monthadar at gmail.com>
Modified:
head/sys/net80211/ieee80211_hwmp.c
Modified: head/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- head/sys/net80211/ieee80211_hwmp.c Sun Jan 29 18:54:25 2012 (r230751)
+++ head/sys/net80211/ieee80211_hwmp.c Sun Jan 29 19:35:40 2012 (r230752)
@@ -1044,12 +1044,21 @@ hwmp_recv_prep(struct ieee80211vap *vap,
* 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;
More information about the svn-src-head
mailing list