aboutsummaryrefslogtreecommitdiff
path: root/net/batman-adv/translation-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r--net/batman-adv/translation-table.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7fb6726ccbd..b25e4b328dc 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -60,10 +60,12 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
int required_bytes;
spin_lock_bh(&bat_priv->hna_lhash_lock);
+ rcu_read_lock();
hna_local_entry =
((struct hna_local_entry *)hash_find(bat_priv->hna_local_hash,
compare_orig, choose_orig,
addr));
+ rcu_read_unlock();
spin_unlock_bh(&bat_priv->hna_lhash_lock);
if (hna_local_entry) {
@@ -116,9 +118,11 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
/* remove address from global hash if present */
spin_lock_bh(&bat_priv->hna_ghash_lock);
+ rcu_read_lock();
hna_global_entry = ((struct hna_global_entry *)
hash_find(bat_priv->hna_global_hash,
compare_orig, choose_orig, addr));
+ rcu_read_unlock();
if (hna_global_entry)
_hna_global_del_orig(bat_priv, hna_global_entry,
@@ -252,9 +256,11 @@ void hna_local_remove(struct bat_priv *bat_priv,
spin_lock_bh(&bat_priv->hna_lhash_lock);
+ rcu_read_lock();
hna_local_entry = (struct hna_local_entry *)
hash_find(bat_priv->hna_local_hash, compare_orig, choose_orig,
addr);
+ rcu_read_unlock();
if (hna_local_entry)
hna_local_del(bat_priv, hna_local_entry, message);
@@ -334,9 +340,11 @@ void hna_global_add_orig(struct bat_priv *bat_priv,
spin_lock_bh(&bat_priv->hna_ghash_lock);
hna_ptr = hna_buff + (hna_buff_count * ETH_ALEN);
+ rcu_read_lock();
hna_global_entry = (struct hna_global_entry *)
hash_find(bat_priv->hna_global_hash, compare_orig,
choose_orig, hna_ptr);
+ rcu_read_unlock();
if (!hna_global_entry) {
spin_unlock_bh(&bat_priv->hna_ghash_lock);
@@ -368,9 +376,11 @@ void hna_global_add_orig(struct bat_priv *bat_priv,
spin_lock_bh(&bat_priv->hna_lhash_lock);
hna_ptr = hna_buff + (hna_buff_count * ETH_ALEN);
+ rcu_read_lock();
hna_local_entry = (struct hna_local_entry *)
hash_find(bat_priv->hna_local_hash, compare_orig,
choose_orig, hna_ptr);
+ rcu_read_unlock();
if (hna_local_entry)
hna_local_del(bat_priv, hna_local_entry,
@@ -483,9 +493,11 @@ void hna_global_del_orig(struct bat_priv *bat_priv,
while ((hna_buff_count + 1) * ETH_ALEN <= orig_node->hna_buff_len) {
hna_ptr = orig_node->hna_buff + (hna_buff_count * ETH_ALEN);
+ rcu_read_lock();
hna_global_entry = (struct hna_global_entry *)
hash_find(bat_priv->hna_global_hash, compare_orig,
choose_orig, hna_ptr);
+ rcu_read_unlock();
if ((hna_global_entry) &&
(hna_global_entry->orig_node == orig_node))
@@ -521,9 +533,11 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv, uint8_t *addr)
struct hna_global_entry *hna_global_entry;
spin_lock_bh(&bat_priv->hna_ghash_lock);
+ rcu_read_lock();
hna_global_entry = (struct hna_global_entry *)
hash_find(bat_priv->hna_global_hash,
compare_orig, choose_orig, addr);
+ rcu_read_unlock();
spin_unlock_bh(&bat_priv->hna_ghash_lock);
if (!hna_global_entry)