diff options
author | monthadar <monthadar@FreeBSD.org> | 2013-02-07 21:21:40 +0000 |
---|---|---|
committer | monthadar <monthadar@FreeBSD.org> | 2013-02-07 21:21:40 +0000 |
commit | aeaacfbfb306ce87345043b9801b6c37972af99c (patch) | |
tree | d253664a26038736e4f28be168a8b0ba47d674c6 /sys/net80211 | |
parent | 3f965e686d057f5a9c3230680185415dc3356a1a (diff) | |
download | FreeBSD-src-aeaacfbfb306ce87345043b9801b6c37972af99c.zip FreeBSD-src-aeaacfbfb306ce87345043b9801b6c37972af99c.tar.gz |
Mesh: management mesh action frames are to be discarded
when not peered.
* Modified ieee80211_recv_action to check if neighbour is peered for
IEEE80211_ACTION_CAT_MESH frames, if not frame is discarded. This is
according to IEEE802.11 2012 standard;
* Removed duplicate checks in each hwmp_recv_* handlers because HWMP
is a subtype of mesh action;
Approved by: adrian (mentor)
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_action.c | 10 | ||||
-rw-r--r-- | sys/net80211/ieee80211_hwmp.c | 15 |
2 files changed, 11 insertions, 14 deletions
diff --git a/sys/net80211/ieee80211_action.c b/sys/net80211/ieee80211_action.c index d28e291..e3576d6 100644 --- a/sys/net80211/ieee80211_action.c +++ b/sys/net80211/ieee80211_action.c @@ -228,6 +228,7 @@ ieee80211_recv_action(struct ieee80211_node *ni, { #define N(a) (sizeof(a) / sizeof(a[0])) ieee80211_recv_action_func *f = recv_inval; + struct ieee80211vap *vap = ni->ni_vap; const struct ieee80211_action *ia = (const struct ieee80211_action *) frm; @@ -245,6 +246,15 @@ ieee80211_recv_action(struct ieee80211_node *ni, f = meshpl_recv_action[ia->ia_action]; break; case IEEE80211_ACTION_CAT_MESH: + if (ni == vap->iv_bss || + ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, + ni->ni_macaddr, NULL, + "peer link not yet established (%d), cat %s act %u", + ni->ni_mlstate, "mesh action", ia->ia_action); + vap->iv_stats.is_mesh_nolink++; + break; + } if (ia->ia_action < N(meshaction_recv_action)) f = meshaction_recv_action[ia->ia_action]; break; diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 7c8b3f9..07b337c 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -914,9 +914,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni, ieee80211_hwmp_seq preqid; /* last seen preqid for orig */ uint32_t metric = 0; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) - return; /* * Ignore PREQs from us. Could happen because someone forward it * back to us. @@ -1233,10 +1230,6 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni, int is_encap; struct ieee80211_node *ni_encap; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) - return; - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PREP, orig %6D, targ %6D", prep->prep_origaddr, ":", prep->prep_targetaddr, ":"); @@ -1505,10 +1498,6 @@ hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni, struct ieee80211_meshperr_ie *pperr = NULL; int i, j = 0, forward = 0; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) - return; - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PERR from %6D", wh->i_addr2, ":"); @@ -1712,9 +1701,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, struct ieee80211_node *ni, struct ieee80211_meshrann_ie prann; uint32_t metric = 0; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED || - IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) + if (IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) return; rt = ieee80211_mesh_rt_find(vap, rann->rann_addr); |