aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@web.de>2011-03-14 22:43:37 +0000
committerSven Eckelmann <sven@narfation.org>2011-04-17 21:11:01 +0200
commite1a5382f978b67b5cc36eec65e6046730ce07714 (patch)
treef7ca07cde3a49858d0cfa33e0189a659a1fcc95d /net/batman-adv/types.h
parent57f0c07c4d0da8bcc23e21c330fe9c7c5cf776b5 (diff)
downloadkernel_samsung_smdk4412-e1a5382f978b67b5cc36eec65e6046730ce07714.zip
kernel_samsung_smdk4412-e1a5382f978b67b5cc36eec65e6046730ce07714.tar.gz
kernel_samsung_smdk4412-e1a5382f978b67b5cc36eec65e6046730ce07714.tar.bz2
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>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r--net/batman-adv/types.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 83445cf..1854cbb 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -67,7 +67,7 @@ struct hard_iface {
struct orig_node {
uint8_t orig[ETH_ALEN];
uint8_t primary_addr[ETH_ALEN];
- struct neigh_node *router;
+ struct neigh_node __rcu *router; /* rcu protected pointer */
unsigned long *bcast_own;
uint8_t *bcast_own_sum;
unsigned long last_valid;
@@ -83,7 +83,7 @@ struct orig_node {
uint32_t last_bcast_seqno;
struct hlist_head neigh_list;
struct list_head frag_list;
- spinlock_t neigh_list_lock; /* protects neighbor list */
+ spinlock_t neigh_list_lock; /* protects neigh_list and router */
atomic_t refcount;
struct rcu_head rcu;
struct hlist_node hash_entry;