summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/soft-interface.c
Commit message (Collapse)AuthorAgeFilesLines
* batman-adv: update copyright yearsAntonio Quartulli2013-01-191-1/+1
| | | | | Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: postpone sysfs removal when unregisteringSimon Wunderlich2013-01-191-3/+29
| | | | | | | | | | | | | | When processing the unregister notify for a hard interface, removing the sysfs files may lead to a circular deadlock (rtnl mutex <-> s_active). To overcome this problem, postpone the sysfs removal in a worker. Reported-by: Sasha Levin <sasha.levin@oracle.com> Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: unbloat batadv_priv if debug is not enabledMarek Lindner2013-01-121-0/+2
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: don't compile the BLA switch if not requestedAntonio Quartulli2013-01-121-0/+2
| | | | | | | | | | | | | When the Bridge Loop Avoidance component is not compiled-in, its boolean switch should be not compiled as well. This patch surrounds the switch with a proper ifdef. This behaviour was introduced by 9fd6b0615b5499b270d39a92b8790e206cf75833 ("batman-adv: add bridge loop avoidance compile option") Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: Do not add multicast MAC addresses to translation tableLinus Lüssing2013-01-121-1/+2
| | | | | | | | | | | | | The current translation table mechanism is not suitable for multicast addresses and we are currently flooding such frames anyway. Therefore this patch prevents multicast MAC addresses being added to the translation table. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Acked-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* ethtool: fix drvinfo strings set in driversJiri Pirko2013-01-061-4/+4
| | | | | | | | | | | | Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: remove unnecessary NET_ADDR_RANDOM "bitclean"Jiri Pirko2013-01-031-1/+0
| | | | | | | | NET_ADDR_SET is set in dev_set_mac_address() no need to alter dev->addr_assign_type value in drivers. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
* batman-adv: use ETH_P_BATMANAntonio Quartulli2012-11-301-4/+5
| | | | | | | | The ETH_P_BATMAN ethertype is now defined kernel-wide. Use it instead of the private BATADV_ETH_P_BATMAN define. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-11-171-6/+6
|\ | | | | | | | | | | Minor line offset auto-merges. Signed-off-by: David S. Miller <davem@davemloft.net>
| * batman-adv: process broadcast packets in BLA earlierAntonio Quartulli2012-11-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic in the BLA mechanism may decide to drop broadcast packets because the node may still be in the setup phase. For this reason, further broadcast processing like the early client detection mechanism must be done only after the BLA check. This patches moves the invocation to BLA before any other broadcast processing. This was introduced 30cfd02b60e1cb16f5effb0a01f826c5bb7e4c59 ("batman-adv: detect not yet announced clients") Reported-by: Glen Page <glen.page@thet.net> Signed-off-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: substitute tt_poss_change with a per-tt_entry flagAntonio Quartulli2012-11-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tt_poss_change is a node-wide flag which tells whether the node is in a roaming state (a client recently moved to/away from it) in order to let it apply special re-routing rules. However this flag does not give a clear idea of the current state because it is not possible to understand *which client* is actually involved in the roaming. For this reason a better approach has been chosen: instead of using a node-wide variable, the roaming state is now given by a per-tt_entry ROAM flag which, in case of packet coming through the node, tells the node whether the real destination is in roaming state or not. With this flag change, batadv_check_unicast_ttvn() has also been rearranged in order to better fit the new re-routing logic and to be much more readable. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: Add get_ethtool_stats() support for DATMartin Hundebøll2012-11-071-0/+7
| | | | | | | | | | | | | | Added additional counters for D.A.T. Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: Distributed ARP Table - add runtime switchAntonio Quartulli2012-11-071-0/+3
| | | | | | | | | | | | | | This patch adds a runtime switch that enables the user to turn the DAT feature on or off at runtime Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: Distributed ARP Table - add snooping functions for ARP messagesAntonio Quartulli2012-11-071-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | In case of an ARP message going in or out the soft_iface, it is intercepted and a special action is performed. In particular the DHT helper functions previously implemented are used to store all the ARP entries belonging to the network in order to provide a fast and unicast lookup instead of the classic broadcast flooding mechanism. Each node stores the entries it is responsible for (following the DHT rules) in its soft_iface ARP table. This makes it possible to reuse the kernel data structures and functions for ARP management. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: add UNICAST_4ADDR packet typeAntonio Quartulli2012-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The current unicast packet type does not contain the orig source address. This patches add a new unicast packet (called UNICAST_4ADDR) which provides two new fields: the originator source address and the subtype (the type of the data contained in the packet payload). The former is useful to identify the node which injected the packet into the network and the latter is useful to avoid creating new unicast packet types in the future: a macro defining a new subtype will be enough. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: don't allow ECTP traffic on batman-advSimon Wunderlich2012-10-291-2/+10
| | | | | | | | | | | | | | | | | | We have seen this to break networks when used with bridge loop avoidance. As we can't see any benefit from sending these ancient frames via our mesh, we just drop them. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: Set special lockdep classes to avoid lockdep warningSven Eckelmann2012-10-291-0/+44
|/ | | | | | | | | | | | | | | | | Transmissions over batman-adv devices always start another nested transmission over devices attached to the batman-adv interface. These devices usually use the ethernet lockdep class for the tx_queue lock which is also set by default for all batman-adv devices. Lockdep will detect a nested locking attempt of two locks with the same class and warn about a possible deadlock. This is the default and expected behavior and should not alarm the locking correctness prove mechanism. Therefore, the locks for all netdevice specific tx queues get a special batman-adv lock class to avoid a false positive for each transmission. Reported-by: Linus Luessing <linus.luessing@web.de> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-09-281-2/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/team/team.c drivers/net/usb/qmi_wwan.c net/batman-adv/bat_iv_ogm.c net/ipv4/fib_frontend.c net/ipv4/route.c net/l2tp/l2tp_netlink.c The team, fib_frontend, route, and l2tp_netlink conflicts were simply overlapping changes. qmi_wwan and bat_iv_ogm were of the "use HEAD" variety. With help from Antonio Quartulli. Signed-off-by: David S. Miller <davem@davemloft.net>
| * batman-adv: Fix change mac address of soft iface.Def2012-09-231-2/+5
| | | | | | | | | | | | | | | | Into function interface_set_mac_addr, the function tt_local_add was invoked before updating dev->dev_addr. The new MAC address was not tagged as NoPurge. Signed-off-by: Def <def@laposte.net>
* | batman-adv: change interface_rx to get orig nodeAntonio Quartulli2012-08-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | In order to understand where a broadcast packet is coming from and use this information to detect not yet announced clients, this patch modifies the interface_rx() function by passing a new argument: the orig node corresponding to the node that originated the received packet (if known). This new argument if not NULL for broadcast packets only (other packets does not have source field). Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: Don't break statements after assignment operatorSven Eckelmann2012-08-231-2/+3
| | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: Split batadv_priv in sub-structures for featuresSven Eckelmann2012-08-231-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The structure batadv_priv grows everytime a new feature is introduced. It gets hard to find the parts of the struct that belongs to a specific feature. This becomes even harder by the fact that not every feature uses a prefix in the member name. The variables for bridge loop avoidence, gateway handling, translation table and visualization server are moved into separate structs that are included in the bat_priv main struct. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: convert remaining packet counters to per_cpu_ptr() infrastructureMarek Lindner2012-08-231-17/+34
|/ | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-07-101-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: net/batman-adv/bridge_loop_avoidance.c net/batman-adv/bridge_loop_avoidance.h net/batman-adv/soft-interface.c net/mac80211/mlme.c With merge help from Antonio Quartulli (batman-adv) and Stephen Rothwell (drivers/net/usb/qmi_wwan.c). The net/mac80211/mlme.c conflict seemed easy enough, accounting for a conversion to some new tracing macros. Signed-off-by: David S. Miller <davem@davemloft.net>
| * batman-adv: check incoming packet type for blaSimon Wunderlich2012-07-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the gateway functionality is used, some broadcast packets (DHCP requests) may be transmitted as unicast packets. As the bridge loop avoidance code now only considers the payload Ethernet destination, it may drop the DHCP request for clients which are claimed by other backbone gateways, because it falsely infers from the broadcast address that the right backbone gateway should havehandled the broadcast. Fix this by checking and delegating the batman-adv packet type used for transmission. Reported-by: Guido Iribarren <guidoiribarren@buenosaireslibre.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
* | batman-adv: Don't leak information through uninitialized packet fieldsSven Eckelmann2012-07-011-0/+1
| | | | | | | | | | | | | | | | | | | | The reserved fields in batman-adv packets are not set to a constant value. The content of these memory regions is leaked unintentionally to the network. This regression was introduced in 3b27ffb00fbe9d9189715ea13ce8712e2f0cb0c5 Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* | batman-adv: Remove bat_ prefix from bat_{debugfs, sysfs}.{c, h}Sven Eckelmann2012-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The "bat_" prefix in the source files implementing the batman-adv sysfs and debugfs interface doesn't have a special meaning and are only used by these files and files that implement the actual B.A.T.M.A.N. path finding algorithm. The prefix is better suited to mark files that are used to implement the main part of the path finding. All other files should not use it and therefore gets renamed. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix types structs with batadv_Sven Eckelmann2012-07-011-9/+9
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix packet structs with batadv_Sven Eckelmann2012-07-011-2/+2
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix main enum with BATADV_Sven Eckelmann2012-07-011-3/+3
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix packet enum with BATADV_Sven Eckelmann2012-07-011-2/+2
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix types enum with BATADV_Sven Eckelmann2012-07-011-4/+4
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix gateway enum with BATADV_Sven Eckelmann2012-07-011-5/+5
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix main defines with BATADV_Sven Eckelmann2012-06-281-5/+5
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix types defines with BATADV_Sven Eckelmann2012-06-281-1/+1
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix packet defines with BATADV_Sven Eckelmann2012-06-281-5/+7
| | | | | | | | | | Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix soft-interface local static functions with batadv_Sven Eckelmann2012-06-251-39/+41
| | | | | | | | | | | | | | | | All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix main static inline functions with batadv_Sven Eckelmann2012-06-251-1/+1
| | | | | | | | | | | | | | | | All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix hard-interface static inline functions with batadv_Sven Eckelmann2012-06-241-2/+2
| | | | | | | | | | | | | | | | All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Reformat multiline comments to consistent styleSven Eckelmann2012-06-201-13/+14
| | | | | | | | | | | | | | | | batman-adv doesn't follow the style for multiline comments that David S. Miller prefers. All comments should be reformatted to follow this consistent style to make the code slightly more readable. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix main non-static functions with batadv_Sven Eckelmann2012-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix unicast non-static functions with batadv_Sven Eckelmann2012-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix translation-table non-static functions with batadv_Sven Eckelmann2012-06-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix soft-interface non-static functions with batadv_Sven Eckelmann2012-06-201-8/+8
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix send non-static functions with batadv_Sven Eckelmann2012-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix hard-interface non-static functions with batadv_Sven Eckelmann2012-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix gateway-client non-static functions with batadv_Sven Eckelmann2012-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix bridge_loop_avoidance non-static functions with batadv_Sven Eckelmann2012-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix bat_sysfs non-static functions with batadv_Sven Eckelmann2012-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* | batman-adv: Prefix bat_debugfs non-static functions with batadv_Sven Eckelmann2012-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
OpenPOWER on IntegriCloud