mac80211: update brcmfmac including missing boardrev workaround
[openwrt.git] / package / kernel / mac80211 / patches / 327-mac80211-Remove-MPP-table-entries-with-MPath.patch
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
4
5 Make the mesh_path_del() function remove all mpp table entries
6 that are proxied by the removed mesh path.
7
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>
11 ---
12
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
16         rcu_read_unlock();
17  }
18  
19 +static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata,
20 +                              const u8 *proxy)
21 +{
22 +       struct mesh_table *tbl;
23 +       struct mesh_path *mpp;
24 +       struct mpath_node *node;
25 +       int i;
26 +
27 +       rcu_read_lock();
28 +       read_lock_bh(&pathtbl_resize_lock);
29 +       tbl = resize_dereference_mpp_paths();
30 +       for_each_mesh_entry(tbl, node, i) {
31 +               mpp = node->mpath;
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]);
36 +               }
37 +       }
38 +       read_unlock_bh(&pathtbl_resize_lock);
39 +       rcu_read_unlock();
40 +}
41 +
42  static void table_flush_by_iface(struct mesh_table *tbl,
43                                  struct ieee80211_sub_if_data *sdata)
44  {
45 @@ -892,6 +915,9 @@ int mesh_path_del(struct ieee80211_sub_i
46         int hash_idx;
47         int err = 0;
48  
49 +       /* flush relevant mpp entries first */
50 +       mpp_flush_by_proxy(sdata, addr);
51 +
52         read_lock_bh(&pathtbl_resize_lock);
53         tbl = resize_dereference_mesh_paths();
54         hash_idx = mesh_table_hash(addr, sdata, tbl);