diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2011-08-25 10:36:14 -0700 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-26 10:39:23 -0400 |
commit | c613366113c8956ee869e12558099927586785bb (patch) | |
tree | 0336b039c694ca19b9e5ce42608aebd0ec0b92fe /net/mac80211/mesh_pathtbl.c | |
parent | 25232490af96f899f7e17de2c136e03d2c9ded62 (diff) | |
download | linux-c613366113c8956ee869e12558099927586785bb.tar.gz linux-c613366113c8956ee869e12558099927586785bb.tar.bz2 linux-c613366113c8956ee869e12558099927586785bb.zip |
mac80211: mesh gate fixes
Since a v1 of the mesh gate series was accidentally applied, this patch
contains the changes in v2.
These are:
- automatically make mesh gate a root node.
- use TU_TO_EXP_TIME macro.
- initialize timer instead of checking for NULL timer function.
- cleanups.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_pathtbl.c')
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 75e4b6022b86..3c2bcb2de844 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -288,7 +288,7 @@ static void mesh_path_move_to_queue(struct mesh_path *gate_mpath, struct mesh_path *from_mpath, bool copy) { - struct sk_buff *skb, *cp_skb; + struct sk_buff *skb, *cp_skb = NULL; struct sk_buff_head gateq, failq; unsigned long flags; int num_skbs; @@ -711,6 +711,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata) new_mpath->flags = 0; skb_queue_head_init(&new_mpath->frame_queue); new_node->mpath = new_mpath; + init_timer(&new_mpath->timer); new_mpath->exp_time = jiffies; spin_lock_init(&new_mpath->state_lock); @@ -843,8 +844,7 @@ static void mesh_path_node_reclaim(struct rcu_head *rp) struct mpath_node *node = container_of(rp, struct mpath_node, rcu); struct ieee80211_sub_if_data *sdata = node->mpath->sdata; - if (node->mpath->timer.function) - del_timer_sync(&node->mpath->timer); + del_timer_sync(&node->mpath->timer); atomic_dec(&sdata->u.mesh.mpaths); kfree(node->mpath); kfree(node); @@ -1046,8 +1046,7 @@ static void mesh_path_node_free(struct hlist_node *p, bool free_leafs) mpath = node->mpath; hlist_del_rcu(p); if (free_leafs) { - if (mpath->timer.function) - del_timer_sync(&mpath->timer); + del_timer_sync(&mpath->timer); kfree(mpath); } kfree(node); @@ -1094,7 +1093,6 @@ int mesh_pathtbl_init(void) tbl_mpp->free_node = &mesh_path_node_free; tbl_mpp->copy_node = &mesh_path_node_copy; tbl_mpp->mean_chain_len = MEAN_CHAIN_LEN; - /* XXX: not needed */ tbl_mpp->known_gates = kzalloc(sizeof(struct hlist_head), GFP_ATOMIC); INIT_HLIST_HEAD(tbl_mpp->known_gates); |