batman-adv: protect bonding with rcu locks
bonding / alternating candidates need to be secured by rcu locks
as well. This patch therefore converts the bonding list
from a plain pointer list to a rcu securable lists and references
the bonding candidates.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 4687027..00bfeaf 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -299,6 +299,7 @@
if (!orig_node)
orig_node = transtable_search(bat_priv, ethhdr->h_dest);
+ /* find_router() increases neigh_nodes refcount if found. */
router = find_router(bat_priv, orig_node, NULL);
if (!router)
@@ -306,7 +307,6 @@
/* don't lock while sending the packets ... we therefore
* copy the required data before sending */
-
batman_if = router->if_incoming;
memcpy(dstaddr, router->addr, ETH_ALEN);