aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-04-11batman-adv: add bridge loop avoidance compile optionSimon Wunderlich7-5/+89
The define CONFIG_BATMAN_ADV_BLA switches the bridge loop avoidance on - skip it, and the bridge loop avoidance is not compiled in. This is useful if binary size should be saved or the feature is not needed. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: form groups in the bridge loop avoidanceSimon Wunderlich2-6/+116
backbone gateways may be part of the same LAN, but participate in different meshes. With this patch, backbone gateways form groups by applying the groupid of another backbone gateway if it is higher. After forming the group, they only accept messages from backbone gateways of the same group. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: drop STP over batmanSimon Wunderlich1-0/+8
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: add broadcast duplicate checkSimon Wunderlich5-0/+91
When multiple backbone gateways relay the same broadcast from the backbone into the mesh, other nodes in the mesh may receive this broadcast multiple times. To avoid this, the crc checksums of received broadcasts are recorded and new broadcast packets with the same content may be dropped if received by another gateway. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: don't let backbone gateways exchange tt entriesSimon Wunderlich4-2/+74
As the backbone gateways are connected to the same backbone, they should announce the same clients on the backbone non-exclusively. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: allow multiple entries in tt_global_entriesSimon Wunderlich2-93/+311
as backbone gateways will all independently announce the same clients, also the tt global table must be able to hold multiple originators per client entry. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: export claim tables through debugfsSimon Wunderlich3-0/+64
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: make bridge loop avoidance switchableSimon Wunderlich1-0/+2
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: add basic bridge loop avoidance codeSimon Wunderlich13-10/+1422
This second version of the bridge loop avoidance for batman-adv avoids loops between the mesh and a backbone (usually a LAN). By connecting multiple batman-adv mesh nodes to the same ethernet segment a loop can be created when the soft-interface is bridged into that ethernet segment. A simple visualization of the loop involving the most common case - a LAN as ethernet segment: node1 <-- LAN --> node2 | | wifi <-- mesh --> wifi Packets from the LAN (e.g. ARP broadcasts) will circle forever from node1 or node2 over the mesh back into the LAN. With this patch, batman recognizes backbone gateways, nodes which are part of the mesh and backbone/LAN at the same time. Each backbone gateway "claims" clients from within the mesh to handle them exclusively. By restricting that only responsible backbone gateways may handle their claimed clients traffic, loops are effectively avoided. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: remove old bridge loop avoidance codeSimon Wunderlich9-517/+5
The functionality is to be replaced by an improved implementation, so first clean up. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: encourage batman to take shorter routes by changing the default hop penaltyMarek Lindner1-1/+1
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: Remove declaration of only locally used functionsSven Eckelmann2-16/+14
Signed-off-by: Sven Eckelmann <sven@narfation.org> Acked-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: Replace bitarray operations with bitmapSven Eckelmann6-130/+41
bitarray.c consists mostly of functionality that is already available as part of the standard kernel API. batman-adv could use architecture optimized code and reduce the binary size by switching to the standard functions. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11batman-adv: use ETH_ALEN instead of hardcoded numeric constantsAntonio Quartulli1-13/+13
In packet.h the numeric constant 6 is used instead of the more portable ETH_ALEN define. This patch substitute any hardcoded value with such define. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Sven Eckelmann <sven@narfation.org>
2012-04-11batman-adv: clean up KconfigAntonio Quartulli1-9/+8
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-03-11Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-mergeDavid S. Miller14-194/+145
2012-03-11batman-adv: Remove spaces after a castSven Eckelmann2-3/+3
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-03-11batman-adv: Use {} braces consistent on the arms of a statementSven Eckelmann1-1/+2
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-03-11batman-adv: Don't begin block comments with only a /* lineSven Eckelmann2-13/+3
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-03-11batman-adv: Ignore 80-chars per line limits for stringsSven Eckelmann12-177/+137
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-28Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-mergeDavid S. Miller39-156/+141
2012-02-28batman-adv: Fix indentation of multiline statementsSven Eckelmann9-45/+44
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: use eth_hw_addr_random() instead of random_ether_addr()Danny Kukawka1-3/+2
Use eth_hw_addr_random() instead of calling random_ether_addr() to set addr_assign_type correctly to NET_ADDR_RANDOM. Remove dev_addr in interface_setup(), it's not needed anymore. Reset the state to NET_ADDR_PERM as soon as the MAC get changed via .ndo_set_mac_address. v2: use bitops, adapt to eth_hw_addr_random() Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17batman-adv: Start new development cycleSven Eckelmann1-1/+1
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: TT_CLIENT_PENDING is never set in struct tt_global_entryAntonio Quartulli1-8/+1
Actually the TT_CLIENT_PENDING flag is never set in the tt_global_entry structure, therefore this code is useless and can be removed. Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: code refactoring - move debug print into tt_local_set_pendingAntonio Quartulli1-9/+6
Each tt_local_set_pending is always followed by a bat_dbg invocation. This can be simplified by moving the bat_dbg() call. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: set TT_CLIENT_NEW flag before invoking hash_add()Antonio Quartulli1-5/+5
In case of a new tt_local_entry, the TT_CLIENT_NEW flag has to be set before adding such entry to the hash table. Otherwise, it opens a race condition in which the entry can be found but the flag has not been set. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: Update copyright yearsSven Eckelmann39-39/+39
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: export used routing algorithm via sysfsMarek Lindner1-0/+9
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: refactor tt_global_del() to avoid misalignmentSven Eckelmann1-20/+22
Signed-off-by: Sven Eckelmann <sven@narfation.org> Acked-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: allowing changing the routing algorithm via module parameterMarek Lindner1-0/+24
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: convert time_after instances to has_timed_outMarek Lindner8-30/+24
To increase readability the has_timed_out() functions has been introduced. This patch converts existing time_after() calls to use this wrapper function (if applicable). This patch also converts all timeouts to miliseconds to be consistent. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
2012-02-17batman-adv: convert batman iv algorithm to use dynamic infrastructureMarek Lindner7-129/+129
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: add infrastructure to change routing algorithm at runtimeMarek Lindner7-0/+145
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: warn if added interface is part of a bridgeMarek Lindner1-0/+8
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: Move is_out_of_time() to main.h for general useMartin Hundebøll2-20/+23
Both translation tables and network coding use timeouts to do house keeping, so we might as well share the function used to compare a timestamp+timeout with current time. For readability and simplicity, the function is renamed to has_timed_out() and uses time_is_before_jiffies() instead of time_after(). Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: Rm empty line from is_my_mac() in main.cMartin Hundebøll1-1/+0
Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: simplify bat_ogm_receive API callMarek Lindner3-9/+9
Most of the values in that call are derived from the skb, so we can hand over the skb instead. Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: Explicitly mark the common header structureSven Eckelmann10-98/+87
All batman-adv packets have a common 3 byte header. It can be used to share some code between different code paths, but it was never explicit stated that this header has to be always the same for all packets. Therefore, new code changes always have the problem that they may accidently introduce regressions by moving some elements around. A new structure is introduced that contains the common header and makes it easier visible that these 3 bytes have to be the same for all on-wire packets. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17batman-adv: add tt_initialised flag to the orig_node structAntonio Quartulli3-3/+10
(ttvn == 0) is currently used as initial condition. However this is not a good idea because ttvn gets the vale zero each time after reaching the maximum value (wrap around). For this reason a new flag is added in order to define whether a node has an initialised table or not. Moreover, after invoking tt_global_del_orig(), tt_initialised has to be set to false Reported-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Tested-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-12-16batman-adv: Fix merge error.David S. Miller1-1/+1
I didn't resolve the merge properly during the last pull of the net tree into net-next. The code in the final resolution should set flags to TT_CLIENT_ROAM not TT_CLIENT_PENDING. Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-4/+20
Conflicts: drivers/net/ethernet/freescale/fsl_pq_mdio.c net/batman-adv/translation-table.c net/ipv6/route.c
2011-12-12batman-adv: Only write requested number of byte to user bufferSven Eckelmann1-3/+2
Don't write more than the requested number of bytes of an batman-adv icmp packet to the userspace buffer. Otherwise unrelated userspace memory might get overridden by the kernel. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-12-12batman-adv: Directly check read of icmp packet in copy_from_userSven Eckelmann1-6/+1
The access_ok read check can be directly done in copy_from_user since a failure of access_ok is handled the same way as an error in __copy_from_user. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-12-12batman-adv: bat_socket_read missing checksPaul Kot1-2/+2
Writing a icmp_packet_rr and then reading icmp_packet can lead to kernel memory corruption, if __user *buf is just below TASK_SIZE. Signed-off-by: Paul Kot <pawlkt@gmail.com> [sven@narfation.org: made it checkpatch clean] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-12-07batman-adv: delete global entry in case of roamingAntonio Quartulli1-3/+18
When receiving a DEL change for a client due to a roaming event (change is marked with TT_CLIENT_ROAM), each node has to check if the client roamed to itself or somewhere else. In the latter case the global entry is kept to avoid having no route at all otherwise we can safely delete the global entry Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2011-12-07batman-adv: in case of roaming mark the client with TT_CLIENT_ROAMAntonio Quartulli1-2/+4
In case of a client roaming from node A to node B, the latter have to mark the corresponding global entry with TT_CLIENT_ROAM (instead of TT_CLIENT_PENDING). Marking a global entry with TT_CLIENT_PENDING will end up in keeping such entry forever (because this flag is only meant to be used with local entries and it is never checked on global ones). In the worst case (all the clients roaming to the same node A) the local and the global table will contain exactly the same clients. Batman-adv will continue to work, but the memory usage is duplicated. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2011-12-07batman-adv: format multi-line if in the correct wayAntonio Quartulli1-2/+1
in an multi-line if statement leading edges should line up to the opening parenthesis Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-12-07batman-adv: remove extra negation in gw_out_of_range()Dan Carpenter1-1/+1
There is a typo here where an extra '!' made the check to the opposite of what was intended. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-11-20batman-adv: use unregister_netdevice() when softif_create failsSimon Wunderlich1-1/+1
When entering softif_create(), the rtnl lock has already been acquired by store_mesh_iface(). (store_mesh_iface() -> hardif_enable_interface() -> softif_create) In case of an error, we should therefore call unregister_netdevice() instead of unregister_netdev(). unregister_netdev() tries to acquire the rtnl lock itself and deadlocks in this situation. unregister_netdevice() assumes that the rtnl lock is already been held. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>