diff options
author | Henning Rogge <hrogge@gmail.com> | 2016-02-03 13:58:36 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-02-24 09:04:35 +0100 |
commit | bf5a70e105820eb214d3f33376cf6a3011d2e20c (patch) | |
tree | 196847877a1388c4202654df387bdd1941f6255b | |
parent | cfg80211: basic support for PBSS network type (diff) | |
download | linux-bf5a70e105820eb214d3f33376cf6a3011d2e20c.tar.xz linux-bf5a70e105820eb214d3f33376cf6a3011d2e20c.zip |
mac80211: Remove MPP table entries with MPath
Make the mesh_path_del() function remove all mpp table entries
that are proxied by the removed mesh path.
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index c95bdb8bb452..40ed206b0f60 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -834,6 +834,29 @@ void mesh_path_flush_by_nexthop(struct sta_info *sta) rcu_read_unlock(); } +static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata, + const u8 *proxy) +{ + struct mesh_table *tbl; + struct mesh_path *mpp; + struct mpath_node *node; + int i; + + rcu_read_lock(); + read_lock_bh(&pathtbl_resize_lock); + tbl = resize_dereference_mpp_paths(); + for_each_mesh_entry(tbl, node, i) { + mpp = node->mpath; + if (ether_addr_equal(mpp->mpp, proxy)) { + spin_lock(&tbl->hashwlock[i]); + __mesh_path_del(tbl, node); + spin_unlock(&tbl->hashwlock[i]); + } + } + read_unlock_bh(&pathtbl_resize_lock); + rcu_read_unlock(); +} + static void table_flush_by_iface(struct mesh_table *tbl, struct ieee80211_sub_if_data *sdata) { @@ -891,6 +914,9 @@ int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr) int hash_idx; int err = 0; + /* flush relevant mpp entries first */ + mpp_flush_by_proxy(sdata, addr); + read_lock_bh(&pathtbl_resize_lock); tbl = resize_dereference_mesh_paths(); hash_idx = mesh_table_hash(addr, sdata, tbl); |