summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2017-03-16 10:57:18 +0900
committerAlexander Grund <flamefire89@gmail.com>2024-01-06 13:32:07 +0100
commit312c574ddc97e6eb3ca8496bb070884b4ab6078b (patch)
tree0cb6ce314aeddca15699f556f47fbf856d43e109
parent842bfdb1fe91b78e1bdf51787b735a54498d141f (diff)
mac80211: mesh: drop new node with weak power
On some practical cases, it is useful to drop new node in the distance. Because mesh metric is calculated with hop count and without RSSI information, a node far from local peer and near to destination node could be used as best path. For example, the nodes are located in linear. Distance of 0 - 1 and 1 - 2 and 2 - 3 is 20meters. 0 to 3 signal is very weak. 0 --- 1 --- 2 --- 3 Though most robust path from 0 to 3 is 0 -> 1 -> 2 -> 3, unfortunately, node 0 could recognize node 3 as neighbor. Then node 3 could be next of node 0. This patch aims to avoid such a case. [Johannes:] Dropping the node entirely isn't ideal, but at least with encryption there will be a limit on # of keys the hardware can deal with, and there might also be a limit on the number of stations it supports. Change-Id: If0607006c04bf2ae2e7b839490c86b238e2e41af Signed-off-by: Masashi Honma <masashi.honma@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Backported: Alexander Grund
-rw-r--r--net/mac80211/mesh.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 0226ccb0e5cd..e32e8663bf57 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1114,8 +1114,14 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
return;
- if (mesh_matches_local(sdata, &elems))
- mesh_neighbour_update(sdata, mgmt->sa, &elems);
+ if (mesh_matches_local(sdata, &elems)) {
+ mpl_dbg(sdata, "rssi_threshold=%d,rx_status->signal=%d\n",
+ sdata->u.mesh.mshcfg.rssi_threshold, rx_status->signal);
+ if (!sdata->u.mesh.user_mpm ||
+ sdata->u.mesh.mshcfg.rssi_threshold == 0 ||
+ sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal)
+ mesh_neighbour_update(sdata, mgmt->sa, &elems);
+ }
if (ifmsh->sync_ops)
ifmsh->sync_ops->rx_bcn_presp(sdata,