aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/vis.c
Commit message (Collapse)AuthorAgeFilesLines
* update network codemigrate_3.2Wolfgang Wiedmeyer2015-10-241-67/+47
|
* batman-adv: rename everything from *hna* into *tt* (translation table)Antonio Quartulli2011-05-081-9/+9
| | | | | | | | To be coherent, all the functions/variables/constants have been renamed to the TranslationTable style Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Make bat_priv->primary_if an rcu protected pointerMarek Lindner2011-05-011-11/+26
| | | | | | | | | | | The rcu protected macros rcu_dereference() and rcu_assign_pointer() for the bat_priv->primary_if need to be used, as well as spin/rcu locking. Otherwise we might end up using a primary_if pointer pointing to already freed memory. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Make orig_node->router an rcu protected pointerLinus Lüssing2011-04-171-46/+45
| | | | | | | | | | | | | | 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>
* Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-03-071-82/+110
|\
| * batman-adv: rename batman_if struct to hard_ifaceMarek Lindner2011-03-051-3/+3
| | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: remove orig_hash spinlockMarek Lindner2011-03-051-27/+9
| | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: Correct rcu refcounting for orig_nodeMarek Lindner2011-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race condition all refcount operations have to be atomic. Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: remove extra layer between hash and hash element - hash bucketMarek Lindner2011-03-051-44/+59
| | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: separate ethernet comparing calls from hash functionsMarek Lindner2011-03-051-9/+9
| | | | | | | | | | | | | | Note: The function compare_ether_addr() provided by the Linux kernel requires aligned memory. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: Correct rcu refcounting for neigh_nodeMarek Lindner2011-03-051-6/+27
| | | | | | | | | | | | | | | | | | | | | | It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race condition all refcount operations have to be atomic. Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: protect each hash row with rcu locksMarek Lindner2011-03-051-4/+14
| | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* | Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-01-311-1/+1
|\ \ | |/
| * batman-adv: Update copyright yearsSven Eckelmann2011-01-311-1/+1
| | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Make vis info stack traversal threadsafeSven Eckelmann2011-01-301-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | batman-adv: Remove vis info element in free_infoSven Eckelmann2011-01-301-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | batman-adv: Remove vis info on hashing errorsSven Eckelmann2011-01-301-1/+1
| | | | | | | | | | | | | | | | 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>
* | batman-adv: Fix kernel panic when fetching vis data on a vis serverLinus Lüssing2011-01-251-2/+2
|/ | | | | | | | | | The hash_iterate removal introduced a bug leading to a kernel panic when fetching the vis data on a vis server. That commit forgot to rename one variable name, which this commit fixes now. Reported-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* net: Add batman-adv meshing protocolSven Eckelmann2010-12-161-0/+949
B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is a routing protocol for multi-hop ad-hoc mesh networks. The networks may be wired or wireless. See http://www.open-mesh.org/ for more information and user space tools. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: David S. Miller <davem@davemloft.net>