diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2008-03-01 04:51:25 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-07 00:40:54 +0300 |
commit | 2a8ca29a88e3858685c463ffd19e11c20d14c73a (patch) | |
tree | 78a3cd986d5b136d721b88ef7ee3c1c41374e887 /net/mac80211/mesh_pathtbl.c | |
parent | a00de5d08b4bcd1e95d02667029406224bd0619b (diff) | |
download | linux-2a8ca29a88e3858685c463ffd19e11c20d14c73a.tar.xz |
mac80211: fix mesh_path and sta_info get_by_idx functions
Skip properly entries whose dev does not match.
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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 135022d7ee57..5845dc21ce85 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -98,7 +98,7 @@ struct mesh_path *mesh_path_lookup(u8 *dst, struct net_device *dev) /** * mesh_path_lookup_by_idx - look up a path in the mesh path table by its index * @idx: index - * @dev: local interface + * @dev: local interface, or NULL for all entries * * Returns: pointer to the mesh path structure, or NULL if not found. * @@ -111,7 +111,9 @@ struct mesh_path *mesh_path_lookup_by_idx(int idx, struct net_device *dev) int i; int j = 0; - for_each_mesh_entry(mesh_paths, p, node, i) + for_each_mesh_entry(mesh_paths, p, node, i) { + if (dev && node->mpath->dev != dev) + continue; if (j++ == idx) { if (MPATH_EXPIRED(node->mpath)) { spin_lock_bh(&node->mpath->state_lock); @@ -121,6 +123,7 @@ struct mesh_path *mesh_path_lookup_by_idx(int idx, struct net_device *dev) } return node->mpath; } + } return NULL; } |