[commits] batman-adv; branch, next, updated. v2010.1.0-39-g078eb6a

postmaster at open-mesh.org postmaster at open-mesh.org
Sat Sep 18 18:04:20 CEST 2010

The following commit has been merged in the next branch:
commit 265d3feae9803b10fc7137f7f40b643c82557940
Author: Sven Eckelmann <sven.eckelmann at gmx.de>
Date:   Sat Sep 18 15:35:35 2010 +0000

    batman-adv: Always protect list_for_each_entry_rcu with RCU
    receive_bat_packet is not called with rcu_read_lock so we must ensure by
    ourself that we protect list_for_each_entry_rcu using the correct RCU
    Signed-off-by: Sven Eckelmann <sven.eckelmann at gmx.de>

diff --git a/routing.c b/routing.c
index a07e0e0..5dbff51 100644
--- a/routing.c
+++ b/routing.c
@@ -564,6 +564,7 @@ void receive_bat_packet(struct ethhdr *ethhdr,
 		batman_packet->tq, batman_packet->ttl, batman_packet->version,
+	rcu_read_lock();
 	list_for_each_entry_rcu(batman_if, &if_list, list) {
 		if (batman_if->if_status != IF_ACTIVE)
@@ -586,6 +587,7 @@ void receive_bat_packet(struct ethhdr *ethhdr,
 		if (compare_orig(ethhdr->h_source, broadcast_addr))
 			is_broadcast = 1;
+	rcu_read_unlock();
 	if (batman_packet->version != COMPAT_VERSION) {
 		bat_dbg(DBG_BATMAN, bat_priv,


More information about the commits mailing list