batman-adv: Make orig_node->router an rcu protected pointer
authorLinus Lüssing <linus.luessing@web.de>
Mon, 14 Mar 2011 22:43:37 +0000 (22:43 +0000)
committerSven Eckelmann <sven@narfation.org>
Sun, 17 Apr 2011 19:11:01 +0000 (21:11 +0200)
commite1a5382f978b67b5cc36eec65e6046730ce07714
treef7ca07cde3a49858d0cfa33e0189a659a1fcc95d
parent57f0c07c4d0da8bcc23e21c330fe9c7c5cf776b5
batman-adv: Make orig_node->router an rcu protected pointer

The rcu protected macros rcu_dereference() and rcu_assign_pointer()
for the orig_node->router need to be used, as well as spin/rcu locking.
Otherwise we might end up using a router pointer pointing to already
freed memory.

Therefore this commit introduces the safe getter method
orig_node_get_router().

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/gateway_client.c
net/batman-adv/icmp_socket.c
net/batman-adv/originator.c
net/batman-adv/originator.h
net/batman-adv/routing.c
net/batman-adv/send.c
net/batman-adv/types.h
net/batman-adv/vis.c