The branch, batman-adv/merge-oopsonly has been created at 1181e1daace88018b2ff66592aa10a4791d705ff (commit)
- Shortlog ------------------------------------------------------------ commit 1181e1daace88018b2ff66592aa10a4791d705ff Author: Sven Eckelmann sven@narfation.org Date: Fri Jan 28 18:34:07 2011 +0100
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
commit dda9fc6b2c59f056e7a2b313b8423b14a4df25a9 Author: Sven Eckelmann sven@narfation.org Date: Fri Jan 28 18:34:06 2011 +0100
batman-adv: Remove vis info element in free_info
The free_info function will be called when no reference to the info object exists anymore. It must be ensured that the allocated memory gets freed and not only the elements which are managed by the info object.
Signed-off-by: Sven Eckelmann sven@narfation.org
commit 2674c15870f888cb732a564fc504ce17654afc64 Author: Sven Eckelmann sven@narfation.org Date: Fri Jan 28 18:34:05 2011 +0100
batman-adv: Remove vis info on hashing errors
A newly created vis info object must be removed when it couldn't be added to the hash. The old_info which has to be replaced was already removed and isn't related to the hash anymore.
Signed-off-by: Sven Eckelmann sven@narfation.org
-----------------------------------------------------------------------