aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-01-31Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller39-94/+93
2011-01-31batman-adv: Update copyright yearsSven Eckelmann39-39/+39
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-31batman-adv: Remove unused variablesSven Eckelmann2-10/+1
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-31batman-adv: Remove declaration of batman_skb_recvSven Eckelmann2-6/+9
batman_skb_recv can be defined in hard-interface.c as static because it is never used outside of that file. Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-31batman-adv: Remove unused definitionsSven Eckelmann1-15/+0
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-31batman-adv: Remove dangling declaration of hash_remove_elementSven Eckelmann1-5/+0
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-31batman-adv: remove unused parametersSimon Wunderlich4-14/+10
Some function parameters are obsolete now and can be removed. Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-31batman-adv: Calculate correct size for merged packetsSven Eckelmann4-3/+31
The routing algorithm must be able to decide if a fragment can be merged with the missing part and still be passed to a forwarding interface. The fragments can only differ by one byte in case that the original payload had an uneven length. In that situation the sender has to inform all possible receivers that the tail is one byte longer using the flag UNI_FRAG_LARGETAIL. The combination of UNI_FRAG_LARGETAIL and UNI_FRAG_HEAD flag makes it possible to calculate the correct length for even and uneven sized payloads. The original formula missed to add the unicast header at all and forgot to remove the fragment header of the second fragment. This made the results highly unreliable and only useful for machines with large differences between the configured MTUs. Reported-by: Russell Senior <russell@personaltelco.net> Reported-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-31batman-adv: Create roughly equal sized fragmentsSven Eckelmann1-2/+3
The routing algorithm must know how large two fragments are to be able to decide that it is safe to merge them or if it should resubmit without waiting for the second part. When these two fragments have a too different size, it is not possible to guess right in every situation. The user could easily configure the MTU of the attached cards so that one fragment is forwarded and the other one is added to the fragments table to wait for the missing part. For even sized packets, it is possible to split it so that the resulting packages are equal sized by ignoring the old non-fragment header at the beginning of the original packet. This still creates different sized fragments for uneven sized packets. Reported-by: Russell Senior <russell@personaltelco.net> Reported-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-30batman-adv: Make vis info stack traversal threadsafeSven Eckelmann1-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>
2011-01-30batman-adv: Remove vis info element in free_infoSven Eckelmann1-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>
2011-01-30batman-adv: Remove vis info on hashing errorsSven Eckelmann1-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>
2011-01-25batman-adv: Fix kernel panic when fetching vis data on a vis serverLinus Lüssing1-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>
2011-01-16batman-adv: Use "__attribute__" shortcut macrosSven Eckelmann3-12/+12
Linux 2.6.21 defines different macros for __attribute__ which are also used inside batman-adv. The next version of checkpatch.pl warns about the usage of __attribute__((packed))). Linux 2.6.33 defines an extra macro __always_unused which is used to assist source code analyzers and can be used to removed the last existing __attribute__ inside the source code. Signed-off-by: Sven Eckelmann <sven@narfation.org>
2011-01-13batman-adv: Even Batman should not dereference NULL pointersJesper Juhl1-2/+4
There's a problem in net/batman-adv/unicast.c::frag_send_skb(). dev_alloc_skb() allocates memory and may fail, thus returning NULL. If this happens we'll pass a NULL pointer on to skb_split() which in turn hands it to skb_split_inside_header() from where it gets passed to skb_put() that lets skb_tail_pointer() play with it and that function dereferences it. And thus the bat dies. While I was at it I also moved the call to dev_alloc_skb() above the assignment to 'unicast_packet' since there's no reason to do that assignment if the memory allocation fails. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
2010-12-20batman-adv: Return hna count on local buffer fillSven Eckelmann1-1/+1
hna_local_fill_buffer must return the number of added hna entries and not the last checked hash bucket. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-16net: Add batman-adv meshing protocolSven Eckelmann40-0/+9944
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>