1 From: Henning Rogge <hrogge@gmail.com>
2 Date: Wed, 3 Feb 2016 13:58:36 +0100
3 Subject: [PATCH] mac80211: Remove MPP table entries with MPath
5 Make the mesh_path_del() function remove all mpp table entries
6 that are proxied by the removed mesh path.
8 Acked-by: Bob Copeland <me@bobcopeland.com>
9 Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
10 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 --- a/net/mac80211/mesh_pathtbl.c
14 +++ b/net/mac80211/mesh_pathtbl.c
15 @@ -835,6 +835,29 @@ void mesh_path_flush_by_nexthop(struct s
19 +static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata,
22 + struct mesh_table *tbl;
23 + struct mesh_path *mpp;
24 + struct mpath_node *node;
28 + read_lock_bh(&pathtbl_resize_lock);
29 + tbl = resize_dereference_mpp_paths();
30 + for_each_mesh_entry(tbl, node, i) {
32 + if (ether_addr_equal(mpp->mpp, proxy)) {
33 + spin_lock(&tbl->hashwlock[i]);
34 + __mesh_path_del(tbl, node);
35 + spin_unlock(&tbl->hashwlock[i]);
38 + read_unlock_bh(&pathtbl_resize_lock);
42 static void table_flush_by_iface(struct mesh_table *tbl,
43 struct ieee80211_sub_if_data *sdata)
45 @@ -892,6 +915,9 @@ int mesh_path_del(struct ieee80211_sub_i
49 + /* flush relevant mpp entries first */
50 + mpp_flush_by_proxy(sdata, addr);
52 read_lock_bh(&pathtbl_resize_lock);
53 tbl = resize_dereference_mesh_paths();
54 hash_idx = mesh_table_hash(addr, sdata, tbl);