summaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/icmp_socket.c
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2010-09-05 01:58:35 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-05 00:29:49 -0700
commit8c70f13832ecaa0e4fc312d38990a25bc99e633b (patch)
tree7f6df2f4a78cea92ed25329c3243bb8d71cbe3ad /drivers/staging/batman-adv/icmp_socket.c
parent6a0e9fa88df9e3a517a2fd317706aefa10a43191 (diff)
downloadop-kernel-dev-8c70f13832ecaa0e4fc312d38990a25bc99e633b.zip
op-kernel-dev-8c70f13832ecaa0e4fc312d38990a25bc99e633b.tar.gz
Staging: batman-adv: multiple mesh clouds
This patch removes all remaining global variables and includes the necessary bits into the bat_priv structure. It is the last remaining piece to allow multiple concurrent mesh clouds on the same device. A few global variables have been rendered obsolete during the process and have been removed entirely. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> [sven.eckelmann@gmx.de: Rework on top of current version] Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/icmp_socket.c')
-rw-r--r--drivers/staging/batman-adv/icmp_socket.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/batman-adv/icmp_socket.c b/drivers/staging/batman-adv/icmp_socket.c
index 2a1d3dd..24627be 100644
--- a/drivers/staging/batman-adv/icmp_socket.c
+++ b/drivers/staging/batman-adv/icmp_socket.c
@@ -218,11 +218,12 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
goto free_skb;
}
- if (atomic_read(&module_state) != MODULE_ACTIVE)
+ if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE)
goto dst_unreach;
- spin_lock_irqsave(&orig_hash_lock, flags);
- orig_node = (struct orig_node *)hash_find(orig_hash, icmp_packet->dst);
+ spin_lock_irqsave(&bat_priv->orig_hash_lock, flags);
+ orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash,
+ icmp_packet->dst));
if (!orig_node)
goto unlock;
@@ -233,7 +234,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
batman_if = orig_node->router->if_incoming;
memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);
- spin_unlock_irqrestore(&orig_hash_lock, flags);
+ spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags);
if (!batman_if)
goto dst_unreach;
@@ -253,7 +254,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
goto out;
unlock:
- spin_unlock_irqrestore(&orig_hash_lock, flags);
+ spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags);
dst_unreach:
icmp_packet->msg_type = DESTINATION_UNREACHABLE;
bat_socket_add_packet(socket_client, icmp_packet, packet_len);
OpenPOWER on IntegriCloud