linux-stable-rt/net/batman-adv
Sven Eckelmann 1181e1daac batman-adv: Make vis info stack traversal threadsafe
The batman-adv vis server has to a stack which stores all information
about packets which should be send later. This stack is protected
with a spinlock that is used to prevent concurrent write access to it.

The send_vis_packets function has to take all elements from the stack
and send them to other hosts over the primary interface. The send will
be initiated without the lock which protects the stack.

The implementation using list_for_each_entry_safe has the problem that
it stores the next element as "safe ptr" to allow the deletion of the
current element in the list. The list may be modified during the
unlock/lock pair in the loop body which may make the safe pointer
not pointing to correct next element.

It is safer to remove and use the first element from the stack until no
elements are available. This does not need reduntant information which
would have to be validated each time the lock was removed.

Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-30 10:32:08 +01:00
..
Kconfig
Makefile
aggregation.c
aggregation.h
bat_debugfs.c
bat_debugfs.h
bat_sysfs.c
bat_sysfs.h
bitarray.c
bitarray.h
gateway_client.c
gateway_client.h
gateway_common.c
gateway_common.h
hard-interface.c
hard-interface.h
hash.c
hash.h
icmp_socket.c
icmp_socket.h
main.c
main.h batman-adv: Use "__attribute__" shortcut macros 2011-01-16 03:25:19 +01:00
originator.c
originator.h
packet.h batman-adv: Use "__attribute__" shortcut macros 2011-01-16 03:25:19 +01:00
ring_buffer.c
ring_buffer.h
routing.c
routing.h
send.c
send.h
soft-interface.c
soft-interface.h
translation-table.c
translation-table.h
types.h batman-adv: Use "__attribute__" shortcut macros 2011-01-16 03:25:19 +01:00
unicast.c batman-adv: Even Batman should not dereference NULL pointers 2011-01-13 22:11:12 +01:00
unicast.h
vis.c batman-adv: Make vis info stack traversal threadsafe 2011-01-30 10:32:08 +01:00
vis.h