summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
Commit message (Collapse)AuthorAgeFilesLines
* batman-adv: change the MAC of each VLAN upon ndo_set_mac_addressAntonio Quartulli2015-06-071-3/+9
| | | | | | | | | | | The MAC address of the soft-interface is used to initialise the "non-purge" TT entry of each existing VLAN. Therefore when the user invokes ndo_set_mac_address() all the "non-purge" TT entries have to be updated, not only the one belonging to the non-tagged network. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Remove unused post-VLAN ethhdr in batadv_gw_dhcp_recipient_getSven Eckelmann2015-06-071-5/+0
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Clarify calculation precedence for '&' and '?'Sven Eckelmann2015-06-073-23/+23
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Add required includes to all filesSven Eckelmann2015-06-0741-158/+703
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header files could not be build indepdent from each other. This is happened because headers didn't include the files for things they've used. This was problematic because the success of a build depended on the knowledge about the right order of local includes. Also source files were not including everything they've used explicitly. Instead they required that transitive includes are always stable. This is problematic because some transitive includes are not obvious, depend on config settings and may not be stable in the future. The order for include blocks are: * primary headers (main.h and the *.h file of a *.c file) * global linux headers * required local headers * extra forward declarations for pointers in function/struct declarations The only exceptions are linux/bitops.h and linux/if_ether.h in packet.h. This header file is shared with userspace applications like batctl and must therefore build together with userspace applications. The header linux/bitops.h is not part of the uapi headers and linux/if_ether.h conflicts with the musl implementation of netinet/if_ether.h. The maintainers rejected the use of __KERNEL__ preprocessor checks and thus these two headers are only in main.h. All files using packet.h first have to include main.h to work correctly. Reported-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: add bat_neigh_free APIAntonio Quartulli2015-06-072-0/+10
| | | | | | | | This API has to be used to let any routing protocol free neighbor specific allocated resources Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: split name from variable for uint mesh attributesAntonio Quartulli2015-06-071-14/+15
| | | | | | | | | | | | | Some mesh attributes are behind substructs in the batadv_priv object and for this reason the name cannot be used anymore to refer to them. This patch allows to specify the variable name where the attribute is stored inside batadv_priv instead of using the name Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Use common Jenkins Hash implementationSven Eckelmann2015-06-077-62/+25
| | | | | | | | | | | | | An unoptimized version of the Jenkins one-at-a-time hash function is used and partially copied all over the code wherever an hashtable is used. Instead the optimized version shared between the whole kernel should be used to reduce code duplication and use better optimized code. Only the DAT code must use the old implementation because it is used as distributed hash function which has to be common for all nodes. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Remove unnecessary ret variable in algo_registerMarkus Pargmann2015-06-031-5/+2
| | | | | | | Remove ret variable and all jumps. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Remove unnecessary ret variableMarkus Pargmann2015-06-031-8/+3
| | | | | | | | We can avoid this indirect return variable by directly returning the error values. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: main, batadv_compare_eth return boolMarkus Pargmann2015-06-031-1/+1
| | | | | | | | | | Declare the returntype of batadv_compare_eth as bool. The function called inside this helper function (ether_addr_equal_unaligned) also uses bool as return value, so there is no need to return int. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: main, Convert is_my_mac() to boolMarkus Pargmann2015-06-032-5/+8
| | | | | | | | It is much clearer to see a bool type as return value than 'int' for functions that are supposed to return true or false. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Remove unnecessary check for orig_ifinfo not NULLSven Eckelmann2015-06-031-2/+1
| | | | | | | | | | orig_ifinfo is dereferenced multiple times in batadv_iv_ogm_update_seqnos before the check for NULL is done. The function also exists at the beginning when orig_ifinfo would have been NULL. This makes the check at the end unnecessary and only confuses the reader/code analyzers. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: types, Fix comment on bcast_ownMarkus Pargmann2015-06-031-3/+4
| | | | | | | | | batadv_orig_bat_iv->bcast_own is actually not a bitfield, it is an array. Adjust the comment accordingly. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm, fix comment function nameMarkus Pargmann2015-06-031-1/+1
| | | | | | | This is a small copy paste fix for batadv_ing_buffer_avg. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm, fix coding styleMarkus Pargmann2015-06-031-1/+3
| | | | | | | | The kernel coding style says, that there should not be multiple assignments in one row. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm, Fix dup_status commentMarkus Pargmann2015-06-031-1/+1
| | | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm_orig_update, style, add missing bracketsMarkus Pargmann2015-06-031-1/+2
| | | | | | | | CodingStyle describes that either none or both branches of a conditional have to have brackets. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm_queue_add, Simplify expressionsMarkus Pargmann2015-06-031-2/+2
| | | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm_aggregate_new, simplify error handlingMarkus Pargmann2015-06-031-15/+13
| | | | | | | | It is just a bit easier to put the error handling at one place and let multiple error paths use the same calls. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Use common declaration order in *_send_skb_(packet|unicast)Antonio Quartulli2015-05-291-1/+1
| | | | Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
* batman-adv: iv_ogm_orig_update, remove unnecessary bracketsMarkus Pargmann2015-05-291-1/+1
| | | | | | | Remove these unnecessary brackets inside a condition. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm_can_aggregate, code readabilityMarkus Pargmann2015-05-291-49/+53
| | | | | | | | | | This patch tries to increase code readability by negating the first if block and rearranging some of the other conditional blocks. This way we save an indentation level, we also save some allocation that is not necessary for one of the conditions. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: checkpatch - spaces preferred around that '*'Marek Lindner2015-05-292-2/+2
| | | | Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: checkpatch - comparison to NULL could be rewrittenMarek Lindner2015-05-291-1/+1
| | | | Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Use safer default config for optional featuresSven Eckelmann2015-05-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current default settings for optional features in batman-adv seems to be based around the idea that the user only compiles what he requires. They will automatically enabled when they are compiled in. For example the network coding part of batman-adv is by default disabled in the out-of-tree module but will be enabled when the code is compiled during the module build. But distributions like Debian just enable all features of the batman-adv kernel module and hope that more experimental features or features with possible negative effects have to be enabled using some runtime configuration interface. The network_coding feature can help in specific setups but also has drawbacks and is not disabled by default in the out-of-tree module. Disabling by default in the runtime config seems to be also quite sane. The bridge_loop_avoidance is the only feature which is disabled by default but may be necessary even in simple setups. Packet loops may even be created during the initial node setup when this is not enabled. This is different than STP on bridges because mesh is usually used on Adhoc WiFi. Having two nodes (by accident) in the same LAN segment and in the same mesh network is rather common in this situation. Signed-off-by: Sven Eckelmann <sven@narfation.org> Acked-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm_send_to_if, declare char* as constMarkus Pargmann2015-05-291-1/+1
| | | | | | | | This string pointer is later assigned to a constant string, so it should be defined constant at the beginning. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm_aggr_packet, bool return valueMarkus Pargmann2015-05-291-2/+2
| | | | | | | | This function returns bool values, so it should be defined to return them instead of the whole int range. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: iv_ogm_iface_enable, direct return valuesMarkus Pargmann2015-05-291-6/+2
| | | | | | | Directly return error values. No need to use a return variable. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Makefile, Sort alphabeticallyMarkus Pargmann2015-05-291-1/+1
| | | | | | | | The whole Makefile is sorted, just the multicast rule is not at the right position. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: tvlv realloc, move error handling into if blockMarkus Pargmann2015-05-291-8/+8
| | | | | | | | Instead of hiding the normal function flow inside an if block, we should just put the error handling into the if block. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: debugfs, avoid compiling for !DEBUG_FSMarkus Pargmann2015-05-293-9/+35
| | | | | | | | | | | | Normally the debugfs framework will return error pointer with -ENODEV for function calls when DEBUG_FS is not set. batman does not notice this error code and continues trying to create debugfs files and executes more code. We can avoid this code execution by disabling compiling debugfs.c when DEBUG_FS is not set. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Use only queued fragments when mergingSven Eckelmann2015-05-291-8/+5
| | | | | | | | | | | | | | | The fragment queueing code now validates the total_size of each fragment, checks when enough fragments are queued to allow to merge them into a single packet and if the fragments have the correct size. Therefore, it is not required to have any other parameter for the merging function than a list of queued fragments. This change should avoid problems like in the past when the different skb from the list and the function parameter were mixed incorrectly. Signed-off-by: Sven Eckelmann <sven@narfation.org> Acked-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Check total_size when queueing fragmentsSven Eckelmann2015-05-292-2/+7
| | | | | | | | | | | | | | | | | | The fragmentation code was replaced in 610bfc6bc99bc83680d190ebc69359a05fc7f605 ("batman-adv: Receive fragmented packets and merge") by an implementation which handles the queueing+merging of fragments based on their size and the total_size of the non-fragmented packet. This total_size is announced by each fragment. The new implementation doesn't check if the the total_size information of the packets inside one chain is consistent. This is consistency check is recommended to allow using any of the packets in the queue to decide whether all fragments of a packet are received or not. Signed-off-by: Sven Eckelmann <sven@narfation.org> Acked-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: update copyright years for 2015Sven Eckelmann2015-05-2943-43/+43
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Start new development cycleSimon Wunderlich2015-05-291-1/+1
| | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* dev: introduce dev_get_iflink()Nicolas Dichtel2015-04-021-2/+3
| | | | | | | | | | | The goal of this patch is to prepare the removal of the iflink field. It introduces a new ndo function, which will be implemented by virtual interfaces. There is no functional change into this patch. All readers of iflink field now call dev_get_iflink(). Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* batman-adv: Fix use of seq_has_overflowed()Joe Perches2015-02-221-1/+1
| | | | | | | | | | net-next commit 6d91147d183c ("batman-adv: Remove uses of return value of seq_printf") incorrectly changed the overflow occurred return from -1 to 1. Change it back so that the test of batadv_write_buffer_text's return value in batadv_gw_client_seq_print_text works properly. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* batman-adv: Remove uses of return value of seq_printfJoe Perches2015-02-201-9/+10
| | | | | | | | | | | This function is soon going to return void so remove the return value use. Convert the return value to test seq_has_overflowed() instead. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* batman-adv: Kconfig, Add missing DEBUG_FS dependencyMarkus Pargmann2015-01-071-0/+1
| | | | | | | | BATMAN_ADV_DEBUG is using debugfs files for the debugging log. So it depends on DEBUG_FS which is missing as dependency in the Kconfig file. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: Start new development cycleSimon Wunderlich2015-01-071-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: fix misspelled wordsAntonio Quartulli2015-01-076-8/+8
| | | | | | Reported-by: checkpatch Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: clear control block of received socket buffersMartin Hundebøll2015-01-071-0/+3
| | | | | | | | | | | | | | | | Since other network components (and some drivers) uses the control block provided in skb's, the network coding feature might wrongly assume that an SKB has been decoded, and thus not try to code it with another packet again. This happens for instance when batman-adv is running on a bridge device. Fix this by clearing the control block for every received SKB. Introduced by 3c12de9a5c756b23fe7c9ab332474ece1568914c ("batman-adv: network coding - code and transmit packets if possible") Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: checkpatch - remove unnecessary parenthesesAntonio Quartulli2015-01-071-2/+2
| | | | | Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: checkpatch - Please don't use multiple blank linesAntonio Quartulli2015-01-0711-18/+0
| | | | | Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: checkpatch - Please use a blank line after declarationsAntonio Quartulli2015-01-074-0/+4
| | | | | Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: checkpatch - No space is necessary after a castAntonio Quartulli2015-01-071-4/+4
| | | | | Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: checkpatch - else is not generally useful after a break or returnAntonio Quartulli2015-01-074-9/+5
| | | | | Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: kernel doc fixes for main.{c, h}Martin Hundebøll2015-01-072-5/+4
| | | | | | Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: kernel doc fix for distributed-arp-table.hMartin Hundebøll2015-01-071-3/+1
| | | | | | | Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Acked-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: kernel doc fixes for bridge_loop_avoidance.cMartin Hundebøll2015-01-071-1/+5
| | | | | | | Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Acked-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
OpenPOWER on IntegriCloud