summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_mesh.c
diff options
context:
space:
mode:
authormonthadar <monthadar@FreeBSD.org>2013-02-07 21:26:40 +0000
committermonthadar <monthadar@FreeBSD.org>2013-02-07 21:26:40 +0000
commitf3631fce3f3e16db66e87041ac6b159a0fe005e0 (patch)
tree7d8d62618527b645835d807e6f9d1a9ec2ef9f5f /sys/net80211/ieee80211_mesh.c
parent9cc12d2c5f7a100b44e6de96a1d195b962db14d3 (diff)
downloadFreeBSD-src-f3631fce3f3e16db66e87041ac6b159a0fe005e0.zip
FreeBSD-src-f3631fce3f3e16db66e87041ac6b159a0fe005e0.tar.gz
HWMP: ic->raw_xmit didn't always point to correct ni.
This is a code re-write. ic->raw_xmit need a pointer to ieee80211_node for the destination node (da). I have reorganized the code so that a pointer to the da node is searched for in the end & in one place. * Make mesh_find_txnode public to be used by HWMP, renamed to ieee80211_mesh_finx_txnode; * changed the argument from ieee80211_node to ieee80211vap for all hwmp_send_* functions; * removed the 'sa' argument from hwmp_send_* functions as all HWMP frames have the source address equal to vap->iv_myaddr; * Modified hwmp_send_action so that if da is MULTCAST ni=vap->iv_bss otherwise we called ieee80211_mesh_find_txnode. Also no need to hold a reference in this functions if da is not MULTICAST as by finding the node it became referenced in ieee80211_find_txnode; Approved by: adrian (mentor)
Diffstat (limited to 'sys/net80211/ieee80211_mesh.c')
-rw-r--r--sys/net80211/ieee80211_mesh.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c
index 1cc4419..38b7cea 100644
--- a/sys/net80211/ieee80211_mesh.c
+++ b/sys/net80211/ieee80211_mesh.c
@@ -77,9 +77,6 @@ static void mesh_checkid(void *, struct ieee80211_node *);
static uint32_t mesh_generateid(struct ieee80211vap *);
static int mesh_checkpseq(struct ieee80211vap *,
const uint8_t [IEEE80211_ADDR_LEN], uint32_t);
-static struct ieee80211_node *
- mesh_find_txnode(struct ieee80211vap *,
- const uint8_t [IEEE80211_ADDR_LEN]);
static void mesh_transmit_to_gate(struct ieee80211vap *, struct mbuf *,
struct ieee80211_mesh_route *);
static void mesh_forward(struct ieee80211vap *, struct mbuf *,
@@ -1005,8 +1002,8 @@ mesh_checkpseq(struct ieee80211vap *vap,
/*
* Iterate the routing table and locate the next hop.
*/
-static struct ieee80211_node *
-mesh_find_txnode(struct ieee80211vap *vap,
+struct ieee80211_node *
+ieee80211_mesh_find_txnode(struct ieee80211vap *vap,
const uint8_t dest[IEEE80211_ADDR_LEN])
{
struct ieee80211_mesh_route *rt;
@@ -1046,7 +1043,7 @@ mesh_transmit_to_gate(struct ieee80211vap *vap, struct mbuf *m,
int error;
eh = mtod(m, struct ether_header *);
- ni = mesh_find_txnode(vap, rt_gate->rt_dest);
+ ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest);
if (ni == NULL) {
ifp->if_oerrors++;
m_freem(m);
@@ -1293,7 +1290,7 @@ mesh_forward(struct ieee80211vap *vap, struct mbuf *m,
ni = ieee80211_ref_node(vap->iv_bss);
mcopy->m_flags |= M_MCAST;
} else {
- ni = mesh_find_txnode(vap, whcopy->i_addr3);
+ ni = ieee80211_mesh_find_txnode(vap, whcopy->i_addr3);
if (ni == NULL) {
/*
* [Optional] any of the following three actions:
OpenPOWER on IntegriCloud