batman-adv: protect each hash row with rcu locks

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
This commit is contained in:
Marek Lindner
2011-01-19 20:01:40 +00:00
parent a775eb847a
commit fb778ea173
8 changed files with 141 additions and 45 deletions

View File

@@ -220,9 +220,11 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
goto dst_unreach;
spin_lock_bh(&bat_priv->orig_hash_lock);
rcu_read_lock();
orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash,
compare_orig, choose_orig,
icmp_packet->dst));
rcu_read_unlock();
if (!orig_node)
goto unlock;