aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_pathtbl.c
diff options
context:
space:
mode:
authorLuis Carlos Cobo <luisca@cozybit.com>2008-02-29 18:04:13 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-03-06 16:40:51 -0500
commitcfa22c716f65b4d286a68aeacee4a7361a4035e6 (patch)
tree52c9c31b7f77b06daa504e283aa73da41be1e6aa /net/mac80211/mesh_pathtbl.c
parent89a1ad6990d884796c5280d13aa58d216dffa08d (diff)
mac80211: always force mesh_path deletions
Postponing the deletion is not really useful anymore. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_pathtbl.c')
-rw-r--r--net/mac80211/mesh_pathtbl.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index bd58849f9df..f74e4ce40ec 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -277,7 +277,7 @@ void mesh_path_flush_by_nexthop(struct sta_info *sta)
277 for_each_mesh_entry(mesh_paths, p, node, i) { 277 for_each_mesh_entry(mesh_paths, p, node, i) {
278 mpath = node->mpath; 278 mpath = node->mpath;
279 if (mpath->next_hop == sta) 279 if (mpath->next_hop == sta)
280 mesh_path_del(mpath->dst, mpath->dev, true); 280 mesh_path_del(mpath->dst, mpath->dev);
281 } 281 }
282} 282}
283 283
@@ -291,7 +291,7 @@ void mesh_path_flush(struct net_device *dev)
291 for_each_mesh_entry(mesh_paths, p, node, i) { 291 for_each_mesh_entry(mesh_paths, p, node, i) {
292 mpath = node->mpath; 292 mpath = node->mpath;
293 if (mpath->dev == dev) 293 if (mpath->dev == dev)
294 mesh_path_del(mpath->dst, mpath->dev, false); 294 mesh_path_del(mpath->dst, mpath->dev);
295 } 295 }
296} 296}
297 297
@@ -314,12 +314,8 @@ static void mesh_path_node_reclaim(struct rcu_head *rp)
314 * @dev: local interface 314 * @dev: local interface
315 * 315 *
316 * Returns: 0 if succesful 316 * Returns: 0 if succesful
317 *
318 * State: if the path is being resolved, the deletion will be postponed until
319 * the path resolution completes or times out, unless the force parameter
320 * is given.
321 */ 317 */
322int mesh_path_del(u8 *addr, struct net_device *dev, bool force) 318int mesh_path_del(u8 *addr, struct net_device *dev)
323{ 319{
324 struct mesh_path *mpath; 320 struct mesh_path *mpath;
325 struct mpath_node *node; 321 struct mpath_node *node;
@@ -338,14 +334,10 @@ int mesh_path_del(u8 *addr, struct net_device *dev, bool force)
338 if (mpath->dev == dev && 334 if (mpath->dev == dev &&
339 memcmp(addr, mpath->dst, ETH_ALEN) == 0) { 335 memcmp(addr, mpath->dst, ETH_ALEN) == 0) {
340 spin_lock_bh(&mpath->state_lock); 336 spin_lock_bh(&mpath->state_lock);
341 if (!force && mpath->flags & MESH_PATH_RESOLVING) { 337 mpath->flags |= MESH_PATH_RESOLVING;
342 mpath->flags |= MESH_PATH_DELETE; 338 hlist_del_rcu(&node->list);
343 } else { 339 call_rcu(&node->rcu, mesh_path_node_reclaim);
344 mpath->flags |= MESH_PATH_RESOLVING; 340 atomic_dec(&mesh_paths->entries);
345 hlist_del_rcu(&node->list);
346 call_rcu(&node->rcu, mesh_path_node_reclaim);
347 atomic_dec(&mesh_paths->entries);
348 }
349 spin_unlock_bh(&mpath->state_lock); 341 spin_unlock_bh(&mpath->state_lock);
350 goto enddel; 342 goto enddel;
351 } 343 }
@@ -508,7 +500,7 @@ void mesh_path_expire(struct net_device *dev)
508 time_after(jiffies, 500 time_after(jiffies,
509 mpath->exp_time + MESH_PATH_EXPIRE)) { 501 mpath->exp_time + MESH_PATH_EXPIRE)) {
510 spin_unlock_bh(&mpath->state_lock); 502 spin_unlock_bh(&mpath->state_lock);
511 mesh_path_del(mpath->dst, mpath->dev, false); 503 mesh_path_del(mpath->dst, mpath->dev);
512 } else 504 } else
513 spin_unlock_bh(&mpath->state_lock); 505 spin_unlock_bh(&mpath->state_lock);
514 } 506 }