summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
Commit message (Collapse)AuthorAgeFilesLines
* netdevice: Kill 'feature' test macros.David S. Miller2011-07-121-16/+0
| | | | | | | | | | | | | | Almost all of these have long outstayed their welcome. And for every one of these macros, there are 10 features for which we didn't add macros. Let's just delete them all, and get out of habit of doing things this way. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
* Merge branch 'batman-adv/next' of git://git.open-mesh.org/linux-mergeDavid S. Miller2011-07-086-32/+147
|\
| * batman-adv: request the full table if tt_crc doesn't matchAntonio Quartulli2011-07-071-0/+12
| | | | | | | | | | | | | | | | In case of tt_crc mismatching for a certain orig_node after applying the changes, the node must request the full table immediately. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: keep global table consistency in case of roamingAntonio Quartulli2011-07-071-2/+8
| | | | | | | | | | | | | | | | | | | | | | To keep consistency of other originator tables, new clients detected as roamed, are kept in the global table but are marked as TT_CLIENT_PENDING They are purged only when the new ttvn is received by the corresponding originator. Moreover they need to be considered as removed in case of global transtable lookup. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: keep local table consistency for further TT_RESPONSEAntonio Quartulli2011-07-074-30/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | To keep transtable consistency among all the nodes, an originator must not send not yet announced clients within a full table TT_RESPONSE. Instead, deleted client have to be kept in the table in order to be sent within an immediate TT_RESPONSE. In this way all the nodes in the network will always provide the same response for the same request. All the modification are committed at the next ttvn increment event. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: initialise last_ttvn and tt_crc for the orig_node structureAntonio Quartulli2011-07-071-0/+2
| | | | | | | | | | | | | | | | The last_ttvn and tt_crc fields of the orig_node structure were not initialised causing an immediate TT_REQ/RES dialogue even if not needed. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* | Merge branch 'batman-adv/next' of git://git.open-mesh.org/linux-mergeDavid S. Miller2011-07-0513-59/+71
|\ \ | |/
| * batman-adv: Replace version info instead of appending themSven Eckelmann2011-07-054-21/+9
| | | | | | | | | | | | | | | | | | | | | | The version number of modules build outside of the tree can get revision numbers added. This is useful to give hints about the revision of a distribution package and the used patchset. The prepended source number or branch name doesn't add any additional information which would help to identify problems and can therefore be omitted. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: aggregation checks should use the primary_if pointerMarek Lindner2011-07-051-5/+20
| | | | | | | | | | | | | | | | | | | | | | The packet aggregation needs to ensure that only compatible packets are aggregated. Some of the checks are based on the interface number while assuming that the first interface also is the primary interface which is not always the case. This patch addresses the issue by using the primary_if pointer. Reported-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: broadcast primary OGM on all active hard-interfacesMarek Lindner2011-07-051-4/+13
| | | | | | | | | | | | | | | | | | | | The primary interface OGM has to be broadcasted on all hard-interfaces even if the primary interface is not the first interface (if_num = 0). Therefore the code has to compare the originating interface with the primary interface instead of checking the if_num. Reported-by: Linus Luessing <linus.luessing@web.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: pass a unique flag arg instead of a sequence of bool onesAntonio Quartulli2011-07-051-11/+10
| | | | | | | | | | | | | | | | now tt_local_event() takes a flags argument instead of a sequence of boolean values which would grow up with the time. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: add_bcast_packet_to_list() takes the sending delay as parameterAntonio Quartulli2011-07-054-5/+5
| | | | | | | | | | | | | | | | | | In order to make possible to use the broadcast list for delayed sendings the "delay" parameter is now provided instead of using 1 as hardcoded value. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * batman-adv: unify flags for tt_change/tt_local_entry/tt_global_entryAntonio Quartulli2011-07-054-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tt_local_entry structure now has a 'flags' field. This helps to unify the flags format to all the client related structures (tt_global_entry and tt_change). The 'never_purge' field is now encoded in the 'flags' one. To optimise the usage of this field, its length has been increased to 16bit in order to use the eight leading bits (from 0 to 7) to store flags that have to be sent on the wire, while the eight ending ones are used for local computation only. Moreover 'enum tt_change_flags' is now called 'enum tt_client_flags' and the defined values apply to the tt_local_entry, tt_global_entry and the tt_change 'flags' field. Signed-off-by: Antonio Quartulli <ordex@autistici.org> 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-06-2027-462/+2080
|\ \ | |/
| * batman-adv: improved gateway tq-based selectionAntonio Quartulli2011-06-204-6/+104
| | | | | | | | | | | | | | | | | | | | If a client issues a DHCPREQUEST for renewal, the packet is dropped if the old destination (the old gateway for the client) TQ is smaller than the current best gateway TQ less GW_THRESHOLD Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: throw uevent in userspace on gateway add/change/del eventAntonio Quartulli2011-06-201-0/+6
| | | | | | | | | | | | | | | | | | | | In case of new default gw, changing the default gw or deleting the default gw a uevent is triggered with type=gw, action=add/change/del and data={GW_ORIG_ADDRESS} (if any). Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: gateway election code refactoringAntonio Quartulli2011-06-203-56/+82
| | | | | | | | | | | | | | | | | | | | The gateway election mechanism has been a little revised. Now the gw_election is trigered by an atomic_t flag (gw_reselect) which is set to 1 in case of election needed, avoding to set curr_gw to NULL. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: add wrapper function to throw uevent in userspaceAntonio Quartulli2011-06-203-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using throw_uevent() is now possible to trigger uevent signal that can be recognised in userspace. Uevents will be triggered through the /devices/virtual/net/{MESH_IFACE} kobject. A triggered uevent has three properties: - type: the event class. Who generates the event (only 'gw' is currently defined). Corresponds to the BATTYPE uevent variable. - action: the associated action with the event ('add'/'change'/'del' are currently defined). Corresponds to the BATACTION uevent variable. - data: any useful data for the userspace. Corresponds to the BATDATA uevent variable. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: protect the local and the global trans-tables with rcuAntonio Quartulli2011-06-205-128/+150
| | | | | | | | | | | | | | | | | | The local and the global translation-tables are now lock free and rcu protected. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: improved roaming mechanismAntonio Quartulli2011-06-2012-33/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the current client announcement implementation, in case of roaming, an update is triggered on the new AP serving the client. At that point the new information is spread around by means of the OGM broadcasting mechanism. Until this operations is not executed, no node is able to correctly route traffic towards the client. This obviously causes packet drops and introduces a delay in the time needed by the client to recover its connections. A new packet type called ROAMING_ADVERTISEMENT is added to account this issue. This message is sent in case of roaming from the new AP serving the client to the old one and will contain the client MAC address. In this way an out-of-OGM update is immediately committed, so that the old node can update its global translation table. Traffic reaching this node will then be redirected to the correct destination utilising the fresher information. Thus reducing the packet drops and the connection recovery delay. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: improved client announcement mechanismAntonio Quartulli2011-06-2018-305/+1381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The client announcement mechanism informs every mesh node in the network of any connected non-mesh client, in order to find the path towards that client from any given point in the mesh. The old implementation was based on the simple idea of appending a data buffer to each OGM containing all the client MAC addresses the node is serving. All other nodes can populate their global translation tables (table which links client MAC addresses to node addresses) using this MAC address buffer and linking it to the node's address contained in the OGM. A node that wants to contact a client has to lookup the node the client is connected to and its address in the global translation table. It is easy to understand that this implementation suffers from several issues: - big overhead (each and every OGM contains the entire list of connected clients) - high latencies for client route updates due to long OGM trip time and OGM losses The new implementation addresses these issues by appending client changes (new client joined or a client left) to the OGM instead of filling it with all the client addresses each time. In this way nodes can modify their global tables by means of "updates", thus reducing the overhead within the OGMs. To keep the entire network in sync each node maintains a translation table version number (ttvn) and a translation table checksum. These values are spread with the OGM to allow all the network participants to determine whether or not they need to update their translation table information. When a translation table lookup is performed in order to send a packet to a client attached to another node, the destination's ttvn is added to the payload packet. Forwarding nodes can compare the packet's ttvn with their destination's ttvn (this node could have a fresher information than the source) and re-route the packet if necessary. This greatly reduces the packet loss of clients roaming from one AP to the next. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Unify the first 3 bytes in each packetAntonio Quartulli2011-06-201-12/+18
| | | | | | | | | | | | | | | | | | The amount of duplicated code in the receive and routing code can be reduced when all headers provide the packet type, version and ttl in the same first bytes. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Reduce usage of charSven Eckelmann2011-06-2011-20/+20
| | | | | | | | | | | | | | | | char was used in different places to store information without really using the characteristics of that data type or by ignoring the fact that char has not a well defined signedness. Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: count_real_packets() in batman-adv assumes char is signedDavid Howells2011-06-203-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | count_real_packets() in batman-adv assumes char is signed, and returns -1 through it: net/batman-adv/routing.c: In function 'receive_bat_packet': net/batman-adv/routing.c:739: warning: comparison is always false due to limited range of data type Use int instead. Signed-off-by: David Howells <dhowells@redhat.com> [sven@narfation.org: Rebase on top of current version] Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Keep interface_tx as local functionSven Eckelmann2011-06-202-2/+1
| | | | | | | | | | | | | | interface_tx is not used outside of soft-interface.c and thus doesn't need to be declared inside soft-interface.h Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Move compare_orig to originator.cSven Eckelmann2011-06-202-8/+8
| | | | | | | | | | | | | | | | compare_orig is only used in context of orig_node which is managed inside originator.c. It is not necessary to keep that function inside the header originator.h. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-06-0910-47/+72
|\ \ | |/
| * batman-adv: use NO_FLAGS define instead of hard-coding 0Marek Lindner2011-06-095-5/+7
| | | | | | | | | | | | | | | | The definition NO_FLAGS was introduced to make the code more readable and shall be used to initialize flag fields. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Use enums for related constantsSven Eckelmann2011-06-093-31/+47
| | | | | | | | | | | | | | | | | | | | CodingStyle "Chapter 12: Macros, Enums and RTL" recommends to use enums for several related constants. Internal states can be used without defining the actual value, but all values which are visible to the outside must be defined as before. Normal values are assigned as usual and flags are defined by shifts of a bit. Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Rewrite debugfs kobj_to_* helpers as functionsSven Eckelmann2011-06-091-3/+11
| | | | | | | | | | | | | | | | CodingStyle "Chapter 12: Macros, Enums and RTL" highly recommends to use functions instead of macros were possible. This ensures type safety and prevents shadowing of other variables. Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Fix signedness problem in parse_gw_bandwidthSven Eckelmann2011-06-091-2/+2
| | | | | | | | | | | | | | strict_strtoul as used in parse_gw_bandwidth is defined for unsigned long and strict_strtol should be used instead for long. Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: Don't return value in void functionSven Eckelmann2011-06-091-1/+1
| | | | | | | | | | | | | | | | gw_node_delete is defined with "void" as return type, but still tries to return a value. The called function gw_node_delete is also return as void and thus doesn't provide a value for us. Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * batman-adv: accept delayed rebroadcasts to avoid bogus routing under heavy loadDaniele Furlan2011-06-091-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | When a link is saturated (re)broadcasts of OGMs are delayed. Under heavy load this delay may exceed the orig interval which leads to OGMs being dropped (the code would only accept an OGM rebroadcast if it arrived before the next OGM was broadcasted). With this patch batman-adv will also accept delayed OGMs in order to avoid a bogus influence on the routing metric. Signed-off-by: Daniele Furlan <daniele.furlan@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | net: Remove unnecessary semicolonsJoe Perches2011-06-051-1/+1
|/ | | | | | | | Semicolons are not necessary after switch/while/for/if braces so remove them. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* batman-adv: Ensure that we really have route changes in update_routeSven Eckelmann2011-05-301-1/+1
| | | | | | | | | | | The debug output of update_route has tests for "route deleted" and "route added". All other situations are handled as "route changed". This is not true because neigh_node and curr_router could be both NULL. The function is not called in this situation, but the code might be interpreted wrong when reading it without this test. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: a multiline comment should precede the variable it is describingAntonio Quartulli2011-05-301-4/+4
| | | | | | | | This comment has been wrongly put after the variable it refers to and was also bad indented Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: use is_broadcast_ether_addr() instead of compare_eth(.., brd_addr)Antonio Quartulli2011-05-301-1/+1
| | | | | | | | | | Instead of comparing mac addresses with the broadcast address by means of compare_eth(), the is_broadcast_ether_addr() kernel function has to be used. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Check type of x and y in seq_(before|after)Sven Eckelmann2011-05-301-2/+5
| | | | | | | | | | | seq_before and seq_after depend on the fact that both sequence numbers have the same type and thus the same bitwidth. We can ensure that by compile time checking using a compare between the pointer to the temporary buffers which were created using the typeof of both parameters. For example gcc would create a warning like "warning: comparison of distinct pointer types lacks a cast". Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: move smallest_signed_int(), seq_before() and seq_after() into main.hAntonio Quartulli2011-05-302-16/+16
| | | | | | | | | | smallest_signed_int(), seq_before() and seq_after() are very useful functions that help to handle comparisons between sequence numbers. However they were only defined in vis.c. With this patch every batman-adv function will be able to use them. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Use rcu_dereference_protected by update-sideSven Eckelmann2011-05-303-3/+4
| | | | | | | | | | Usually rcu_dereference isn't necessary in situations were the RCU-protected data structure cannot change, but sparse and lockdep still need a similar functionality for analysis. rcu_dereference_protected implements the reduced version which should be used to support the dynamic and static analysis. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Calculate sizeof using variable insead of typesSven Eckelmann2011-05-3014-72/+65
| | | | | | | | | | | | | Documentation/CodingStyle recommends to use the form p = kmalloc(sizeof(*p), ...); to calculate the size of a struct and not the version where the struct name is spelled out to prevent bugs when the type of p changes. This also seems appropriate for manipulation of buffers when they are directly associated with p. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Remove casts from type x to type xSven Eckelmann2011-05-302-2/+2
| | | | | | | Casting from pointer like 'struct orig_node*' to 'struct orig_node *' doesn't provide any additional functionality and can be savely removed. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Remove explicit casts cast from void* for storeSven Eckelmann2011-05-303-3/+3
| | | | | | | | It is not necessary to cast a void* to the pointer type when we just store it and don't want to do pointer arithmetic before the actual assignment. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Only use int up and down gw representationSven Eckelmann2011-05-301-9/+10
| | | | | | | | | It is not save to provide memory for an int and then cast the pointer to it to long*. It is better to standardize the up and down gateway bandwith representation to simple ints and only use long inside conversation routines. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Add const type qualifier for pointersSven Eckelmann2011-05-3027-157/+166
| | | | | | | | batman-adv uses pointers which are marked as const and should not violate that type qualifier by passing it to functions which force a cast to the non-const version. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Don't do pointer arithmetic with void*Sven Eckelmann2011-05-301-2/+2
| | | | | | | | The size of void is currently set by gcc to 1, but is not well defined in general. Therefore it is more advisable to cast it to char* before doing pointer arithmetic. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Remove comparising < 0 for unsigned typeSven Eckelmann2011-05-301-1/+1
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Print jiffies as unsigned longSven Eckelmann2011-05-301-1/+1
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Annotate functions with format stringsSven Eckelmann2011-05-302-1/+3
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Use kzalloc rather than kmalloc followed by memset with 0Sven Eckelmann2011-05-301-2/+1
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
OpenPOWER on IntegriCloud