svn commit: r192393 - projects/mesh11s/sys/net80211
Rui Paulo
rpaulo at FreeBSD.org
Tue May 19 17:10:58 UTC 2009
Author: rpaulo
Date: Tue May 19 17:10:57 2009
New Revision: 192393
URL: http://svn.freebsd.org/changeset/base/192393
Log:
Parse path replies and path error IEs.
Ignore data frames with ni pointing to us.
Sponsored by: The FreeBSD Foundation
Modified:
projects/mesh11s/sys/net80211/ieee80211_mesh.c
Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue May 19 15:58:05 2009 (r192392)
+++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue May 19 17:10:57 2009 (r192393)
@@ -266,6 +266,8 @@ mesh_input(struct ieee80211_node *ni, st
switch (type) {
case IEEE80211_FC0_TYPE_DATA:
+ if (ni == vap->iv_bss)
+ goto out;
IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, ni,
"%s", "received data frame");
if (ni->ni_peerstate != IEEE80211_NODE_MESH_ESTABLISHED) {
@@ -628,10 +630,12 @@ mesh_recv_action(struct ieee80211_node *
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211_action *ia;
struct ieee80211_frame *wh;
- struct ieee80211_meshid_ie *meshid;
- struct ieee80211_meshconf_ie *meshconf;
- struct ieee80211_meshpeer_ie *meshpeer;
- struct ieee80211_meshpreq_ie *meshpreq;
+ struct ieee80211_meshid_ie *meshid = NULL;
+ struct ieee80211_meshconf_ie *meshconf = NULL;
+ struct ieee80211_meshpeer_ie *meshpeer = NULL;
+ struct ieee80211_meshpreq_ie *meshpreq = NULL;
+ struct ieee80211_meshprep_ie *meshprep = NULL;
+ struct ieee80211_meshperr_ie *meshperr = NULL;
uint8_t *frm, *efrm;
union ieee80211_send_action_args vargs;
@@ -647,10 +651,7 @@ mesh_recv_action(struct ieee80211_node *
if (ni == vap->iv_bss) {
return;
}
- meshid = NULL;
- meshpeer = NULL;
- meshconf = NULL;
- meshpreq = NULL;
+
while (efrm - frm > 1) {
IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return);
switch (*frm) {
@@ -679,6 +680,20 @@ mesh_recv_action(struct ieee80211_node *
meshpreq->preq_metric =
LE_READ_4(&meshpreq->preq_metric);
break;
+ case IEEE80211_ELEMID_MESHPREP:
+ meshprep = (struct ieee80211_meshprep_ie *) frm;
+ meshprep->prep_targetseq =
+ LE_READ_4(&meshprep->prep_targetseq);
+ meshprep->prep_lifetime =
+ LE_READ_4(&meshprep->prep_lifetime);
+ meshprep->prep_metric =
+ LE_READ_4(&meshprep->prep_metric);
+ meshprep->prep_origseq =
+ LE_READ_4(&meshprep->prep_origseq);
+ break;
+ case IEEE80211_ELEMID_MESHPERR:
+ meshperr = (struct ieee80211_meshperr_ie *) frm;
+ break;
}
frm += frm[1] + 2;
}
More information about the svn-src-projects
mailing list