aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
Commit message (Collapse)AuthorAge
...
| * batman-adv: Move compare_orig to originator.cSven Eckelmann2011-06-20
| | | | | | | | | | | | | | | | 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-09
|\|
| * batman-adv: use NO_FLAGS define instead of hard-coding 0Marek Lindner2011-06-09
| | | | | | | | | | | | | | | | 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-09
| | | | | | | | | | | | | | | | | | | | 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-09
| | | | | | | | | | | | | | | | 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-09
| | | | | | | | | | | | | | 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-09
| | | | | | | | | | | | | | | | 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-09
| | | | | | | | | | | | | | | | | | | | | | | | 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-05
|/ | | | | | | | 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-30
| | | | | | | | | | | 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-30
| | | | | | | | 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-30
| | | | | | | | | | 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-30
| | | | | | | | | | | 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-30
| | | | | | | | | | 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-30
| | | | | | | | | | 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-30
| | | | | | | | | | | | | 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-30
| | | | | | | 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-30
| | | | | | | | 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-30
| | | | | | | | | 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-30
| | | | | | | | 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-30
| | | | | | | | 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-30
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Print jiffies as unsigned longSven Eckelmann2011-05-30
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Annotate functions with format stringsSven Eckelmann2011-05-30
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Use kzalloc rather than kmalloc followed by memset with 0Sven Eckelmann2011-05-30
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: move neigh_node->if_incoming->if_status check in find_router()Antonio Quartulli2011-05-30
| | | | | | | | | Every time that find_router() is invoked, if_status has to be compared with IF_ACTIVE. Moving this comparison inside find_router() will avoid to write it each time. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds2011-05-20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits) macvlan: fix panic if lowerdev in a bond tg3: Add braces around 5906 workaround. tg3: Fix NETIF_F_LOOPBACK error macvlan: remove one synchronize_rcu() call networking: NET_CLS_ROUTE4 depends on INET irda: Fix error propagation in ircomm_lmp_connect_response() irda: Kill set but unused variable 'bytes' in irlan_check_command_param() irda: Kill set but unused variable 'clen' in ircomm_connect_indication() rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport() be2net: Kill set but unused variable 'req' in lancer_fw_download() irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication() atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined. rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer(). rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler() rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection() rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window() pkt_sched: Kill set but unused variable 'protocol' in tc_classify() isdn: capi: Use pr_debug() instead of ifdefs. tg3: Update version to 3.119 tg3: Apply rx_discards fix to 5719/5720 ... Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c as per Davem.
| * Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-05-14
| |\
| | * batman-adv: reset broadcast flood protection on errorMarek Lindner2011-05-14
| | | | | | | | | | | | | | | | | | | | | | | | The broadcast flood protection should be reset to its original value if the primary interface could not be retrieved. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: Add missing hardif_free_ref in forw_packet_freeSven Eckelmann2011-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add_bcast_packet_to_list increases the refcount for if_incoming but the reference count is never decreased. The reference count must be increased for all kinds of forwarded packets which have the primary interface stored and forw_packet_free must decrease them. Also purge_outstanding_packets has to invoke forw_packet_free when a work item was really cancelled. This regression was introduced in 32ae9b221e788413ce68feaae2ca39e406211a0a. Reported-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * | Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-05-08
| |\|
| | * batman-adv: remove duplicate code from function is_bidirectional_neigh()Daniele Furlan2011-05-08
| | | | | | | | | | | | | | | | | | | | | | | | In function is_bidirectional_neigh the code that find out the one hop neighbor is duplicated. Signed-off-by: Daniele Furlan <daniele.furlan@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: Remove multiline comments from line endingSven Eckelmann2011-05-08
| | | | | | | | | | | | | | | | | | | | | | | | It is slightly irritating that comments after a long line span over multiple lines without any code. It is easier to put them before the actual code and reduce the number of lines which the eye has to read. Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: rename everything from *hna* into *tt* (translation table)Antonio Quartulli2011-05-08
| | | | | | | | | | | | | | | | | | | | | | | | To be coherent, all the functions/variables/constants have been renamed to the TranslationTable style Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: Fix refcount imbalance in find_routerMarek Lindner2011-05-08
| | | | | | | | | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: Avoid deadlock between rtnl_lock and s_activeSven Eckelmann2011-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hard_if_event is called by the notifier with rtnl_lock and tries to remove sysfs entries when a NETDEV_UNREGISTER event is received. This will automatically take the s_active lock. The s_active lock is also used when a new interface is added to a meshif through sysfs. In that situation we cannot wait for the rntl_lock before creating the actual batman-adv interface to prevent a deadlock. It is still possible to try to get the rtnl_lock and immediately abort the current operation when the trylock call failed. Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: Remove unnecessary hardif_list_lockSven Eckelmann2011-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hardif_list_lock is unneccessary because we already ensure that no multiple admin operations can take place through rtnl_lock. hardif_list_lock only adds additional overhead and complexity. Critical functions now check whether they are called with rtnl_lock using ASSERT_RTNL. It indirectly fixes the problem that orig_hash_del_if() expects that only one interface is deleted from hardif_list at a time, but hardif_remove_interfaces() removes all at once and then calls orig_hash_del_if(). Reported-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: multi vlan support for bridge loop detectionMarek Lindner2011-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bridge loop detection for batman-adv allows the bat0 interface to be bridged into an ethernet segment which other batman-adv nodes are connected to. In order to also allow multiple VLANs on top of the bat0 interface to be bridged into the ethernet segment this patch extends the aforementioned bridge loop detection. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: remove misplaced commentMarek Lindner2011-05-08
| | | | | | | | | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * | Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-05-02
| |\|
| | * batman-adv: Make bat_priv->primary_if an rcu protected pointerMarek Lindner2011-05-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rcu protected macros rcu_dereference() and rcu_assign_pointer() for the bat_priv->primary_if need to be used, as well as spin/rcu locking. Otherwise we might end up using a primary_if pointer pointing to already freed memory. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: fix gw_node_update() and gw_election()Antonio Quartulli2011-05-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression from c4aac1ab9b973798163b34939b522f01e4d28ac9 - gw_node_update() doesn't add a new gw_node in case of empty curr_gw. This means that at the beginning no gw_node is added, leading to an empty gateway list. - gw_election() is terminating in case of curr_gw == NULL. It has to terminate in case of curr_gw != NULL Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: Move definition of atomic_dec_not_zero() into main.hAntonio Quartulli2011-05-01
| | | | | | | | | | | | | | | | | | | | | | | | atomic_dec_not_zero() is very useful and it is currently defined multiple times. So it is possible to move it in main.h Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: orig_hash_find() manages rcu_lock/unlock internallyAntonio Quartulli2011-05-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | orig_hash_find() manages rcu_lock/unlock internally and doesn't need to be surrounded by rcu_read_lock() / rcu_read_unlock() anymore Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| * | ethtool: cosmetic: Use ethtool ethtool_cmd_speed APIDavid Decotigny2011-04-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the network drivers so that they don't access the ethtool_cmd::speed field directly, but use ethtool_cmd_speed() instead. For most of the drivers, these changes are purely cosmetic and don't fix any problem, such as for those 1GbE/10GbE drivers that indirectly call their own ethtool get_settings()/mii_ethtool_gset(). The changes are meant to enforce code consistency and provide robustness with future larger throughputs, at the expense of a few CPU cycles for each ethtool operation. All drivers compiled with make allyesconfig ion x86_64 have been updated. Tested: make allyesconfig on x86_64 + e1000e/bnx2x work Signed-off-by: David Decotigny <decot@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net: batman-adv: remove rx_csum ethtool_opsMichał Mirosław2011-04-20
| | | | | | | | | | | | | | | Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-04-17
| |\|
| | * batman-adv: Set the txqueuelen to zero when creating soft interfaceAndrew Lunn2011-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like other virtual interfaces, e.g. br0, we don't need a transmit queue. Packets should only be queued on real interfaces which are underneath. In practice this patch makes little difference since the virtual interfaces can accept packets as fast as they come, but the patch will avoid bufferbloat questions to the mailling lists in the future. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: protect softif_neigh by rcuSimon Wunderlich2011-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add get/set wrapper functions for softif_neigh and use rcu functions to manipulate the pointers. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: concentrate all curr_gw related rcu operations in ↵Marek Lindner2011-04-17
| | | | | | | | | | | | | | | | | | | | | select/deselect functions Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>