summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
Commit message (Collapse)AuthorAgeFilesLines
* batman-adv: replace HZ calculations with jiffies_to_msecs()Marek Lindner2012-05-113-8/+13
| | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: rename last_valid to last_seenMarek Lindner2012-05-113-16/+16
| | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: register batman ogm receive function during protocol initMarek Lindner2012-05-115-24/+41
| | | | | | | | | | | The B.A.T.M.A.N. IV OGM receive function still was hard-coded although it is a routing protocol specific function. This patch takes advantage of the dynamic packet handler registration to remove the hard-coded function calls. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: introduce packet type handler array for incoming packetsMarek Lindner2012-05-113-113/+127
| | | | | | | | | | The packet handler array replaces the growing switch statement, thus dealing with incoming packets in a more efficient way. It also adds to possibility to register packet handlers on the fly. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: introduce is_single_hop_neigh variable to increase readabilityMarek Lindner2012-05-111-7/+9
| | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: fix wrong dhcp option list browsingAntonio Quartulli2012-05-111-3/+3
| | | | | | | | | | In is_type_dhcprequest(), while parsing a DHCP message, if the entry we found in the option list is neither a padding nor the dhcp-type, we have to ignore it and jump as many bytes as its length + 1. The "+ 1" byte is given by the subtype field itself that has to be jumped too. Reported-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: skip the window protection test when the originator has no ↵Antonio Quartulli2012-04-181-1/+2
| | | | | | | | | | | | | | | neighbours When we receive an OGM from from a node for the first time, the last_real_seqno field of the orig_node structure has not been initialised yet. The value of this field is used to compute the current ogm-seqno window and therefore the protection mechanism will probably drop the packet due to an out-of-window error. To avoid this situation this patch adds a check to skip the window protection mechanism if no neighbour nodes have already been added. When the first neighbour node is added, the last_real_seqno field is initialised too. Reported-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: print OGM seq numbers as unsigned intAntonio Quartulli2012-04-181-4/+4
| | | | | | | OGM sequence numbers are declared as uint32_t and so they have to printed using %u instead of %d in order to avoid wrong representations. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: use ETH_HLEN instead of sizeof(struct ethhdr)Antonio Quartulli2012-04-189-25/+21
| | | | | | | | Instead of using sizeof(struct ethhdr) it is strongly recommended to use the kernel macro ETH_HLEN. This patch substitute each occurrence of the former expressione with the latter one. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: mark existing ogm variables as batman ivMarek Lindner2012-04-183-5/+5
| | | | | | | | The coming protocol changes also will have a part called "OGM". That makes it necessary to introduce a distinction in the code base. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: rename BATMAN_OGM_LEN to BATMAN_OGM_HLENMarek Lindner2012-04-184-14/+14
| | | | | | | | | Using BATMAN_OGM_LEN leaves one with the impression that this is the full packet size which is not the case. Therefore the variable is renamed. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: refactoring API: find generalized name for bat_ogm_init_primary ↵Marek Lindner2012-04-184-6/+6
| | | | | | | callback Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: handle routing code initialization properlyMarek Lindner2012-04-183-11/+17
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: add iface_disable() callback to routing APIMarek Lindner2012-04-184-2/+11
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: randomize initial seqno to avoid collisionMarek Lindner2012-04-181-0/+5
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: refactoring API: find generalized name for bat_ogm_init callbackMarek Lindner2012-04-184-6/+6
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: move ogm initialization into the proper functionMarek Lindner2012-04-181-1/+7
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: remove duplicated line in commentAntonio Quartulli2012-04-181-1/+0
| | | | | | Remove an accidentally added duplicated line in a function comment Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: convert the tt_crc to network orderAntonio Quartulli2012-04-181-1/+1
| | | | | | | | Before sending out a TT_Request packet we must convert the tt_crc field value to network order (since it is 16bits long). Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* net: cleanup unsigned to unsigned intEric Dumazet2012-04-151-3/+3
| | | | | | | Use of "unsigned int" is preferred to bare "unsigned" in net tree. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* batman-adv: add bridge loop avoidance compile optionSimon Wunderlich2012-04-117-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>
* batman-adv: form groups in the bridge loop avoidanceSimon Wunderlich2012-04-112-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>
* batman-adv: drop STP over batmanSimon Wunderlich2012-04-111-0/+8
| | | | | Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: add broadcast duplicate checkSimon Wunderlich2012-04-115-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>
* batman-adv: don't let backbone gateways exchange tt entriesSimon Wunderlich2012-04-114-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>
* batman-adv: allow multiple entries in tt_global_entriesSimon Wunderlich2012-04-112-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>
* batman-adv: export claim tables through debugfsSimon Wunderlich2012-04-113-0/+64
| | | | | Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: make bridge loop avoidance switchableSimon Wunderlich2012-04-111-0/+2
| | | | | Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: add basic bridge loop avoidance codeSimon Wunderlich2012-04-1113-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>
* batman-adv: remove old bridge loop avoidance codeSimon Wunderlich2012-04-119-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>
* batman-adv: encourage batman to take shorter routes by changing the default ↵Marek Lindner2012-04-111-1/+1
| | | | | | | hop penalty Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: Remove declaration of only locally used functionsSven Eckelmann2012-04-112-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>
* batman-adv: Replace bitarray operations with bitmapSven Eckelmann2012-04-116-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>
* batman-adv: use ETH_ALEN instead of hardcoded numeric constantsAntonio Quartulli2012-04-111-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>
* batman-adv: clean up KconfigAntonio Quartulli2012-04-111-9/+8
| | | | Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-mergeDavid S. Miller2012-03-1114-194/+145
|\
| * batman-adv: Remove spaces after a castSven Eckelmann2012-03-112-3/+3
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: Use {} braces consistent on the arms of a statementSven Eckelmann2012-03-111-1/+2
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: Don't begin block comments with only a /* lineSven Eckelmann2012-03-112-13/+3
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: Ignore 80-chars per line limits for stringsSven Eckelmann2012-03-1112-177/+137
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* | Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-mergeDavid S. Miller2012-02-2839-156/+141
|\ \ | |/
| * batman-adv: Fix indentation of multiline statementsSven Eckelmann2012-02-289-45/+44
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: Start new development cycleSven Eckelmann2012-02-171-1/+1
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: TT_CLIENT_PENDING is never set in struct tt_global_entryAntonio Quartulli2012-02-171-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>
| * batman-adv: code refactoring - move debug print into tt_local_set_pendingAntonio Quartulli2012-02-171-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>
| * batman-adv: set TT_CLIENT_NEW flag before invoking hash_add()Antonio Quartulli2012-02-171-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>
| * batman-adv: Update copyright yearsSven Eckelmann2012-02-1739-39/+39
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: refactor tt_global_del() to avoid misalignmentSven Eckelmann2012-02-171-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>
| * batman-adv: convert time_after instances to has_timed_outMarek Lindner2012-02-178-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>
* | batman-adv: use eth_hw_addr_random() instead of random_ether_addr()Danny Kukawka2012-02-171-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>
OpenPOWER on IntegriCloud