summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
Commit message (Collapse)AuthorAgeFilesLines
...
* batman-adv: Announce new capability via multicast TVLVLinus Lüssing2014-03-227-6/+167
| | | | | | | | | | | If the soft interface of a node is not part of a bridge then a node announces a new multicast TVLV: The existence of this TVLV signalizes that this node is announcing all of its multicast listeners via the translation table infrastructure. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: introduce capability initialization bitfieldLinus Lüssing2014-03-223-9/+11
| | | | | | | | | | | | The new bitfield allows us to keep track whether capability subsets of an originator have gone through their initialization phase yet. The translation table is the only user right now, but a new one will be added soon. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: Multicast Listener Announcements via Translation TableLinus Lüssing2014-03-228-4/+318
| | | | | | | | | | With this patch a node which has no bridge interface on top of its soft interface announces its local multicast listeners via the translation table. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: add kerneldoc for dst_hint argumentAntonio Quartulli2014-03-222-0/+3
| | | | | | | | Some helper functions used along the TX path have now a new "dst_hint" argument but the kerneldoc was missing. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: call unregister_netdev() to have it handle the locking for usMarek Lindner2014-03-221-4/+1Star
| | | | | | Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: fix a few kerneldoc inconsistenciesSimon Wunderlich2014-03-221-5/+5
| | | | | | | Reported-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: prefer ether_addr_copy to memcpyAntonio Quartulli2014-03-2213-71/+70Star
| | | | | | | | On some architectures ether_addr_copy() is slightly faster than memcpy() therefore use the former when possible. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: remove obsolete skb_reset_mac_header() in batadv_bla_tx()Linus Lüssing2014-03-221-3/+0Star
| | | | | | | | | | | | | | | Our .ndo_start_xmit handler (batadv_interface_tx()) can rely on having the skb mac header pointer set correctly since the following commit present in kernels >= 3.9: "net: reset mac header in dev_start_xmit()" (6d1ccff627) Therefore this commit removes the according, now redundant, skb_reset_mac_header() call in batadv_bla_tx(). Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: use vlan_/eth_hdr() instead of skb->data in interface_tx pathLinus Lüssing2014-03-225-14/+18
| | | | | | | | | | | | | | | | | | Our .ndo_start_xmit handler (batadv_interface_tx()) can rely on having the skb mac header pointer set correctly since the following commit present in kernels >= 3.9: "net: reset mac header in dev_start_xmit()" (6d1ccff627) Therefore we can safely use eth_hdr() and vlan_eth_hdr() instead of skb->data now, which spares us some ugly type casts. At the same time set the mac_header in batadv_dat_snoop_incoming_arp_request() before sending the skb along the TX path. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: fix coccinelle warningsFengguang Wu2014-03-221-1/+1
| | | | | | | | | | net/batman-adv/network-coding.c:1535:1-7: Replace memcpy with struct assignment Generated by: coccinelle/misc/memcpy-assign.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2014-02-197-27/+101
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/bonding/bond_3ad.h drivers/net/bonding/bond_main.c Two minor conflicts in bonding, both of which were overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
| * batman-adv: fix potential kernel paging error for unicast transmissionsAntonio Quartulli2014-02-171-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | batadv_send_skb_prepare_unicast(_4addr) might reallocate the skb's data. If it does then our ethhdr pointer is not valid anymore in batadv_send_skb_unicast(), resulting in a kernel paging error. Fixing this by refetching the ethhdr pointer after the potential reallocation. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
| * batman-adv: avoid double free when orig_node initialization failsAntonio Quartulli2014-02-171-4/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | In the failure path of the orig_node initialization routine the orig_node->bat_iv.bcast_own field is free'd twice: first in batadv_iv_ogm_orig_get() and then later in batadv_orig_node_free_rcu(). Fix it by removing the kfree in batadv_iv_ogm_orig_get(). Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
| * batman-adv: free skb on TVLV parsing successAntonio Quartulli2014-02-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the TVLV parsing routine succeed the skb is left untouched thus leading to a memory leak. Fix this by consuming the skb in case of success. Introduced by ef26157747d42254453f6b3ac2bd8bd3c53339c3 ("batman-adv: tvlv - basic infrastructure") Reported-by: Russel Senior <russell@personaltelco.net> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Tested-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
| * batman-adv: fix TT CRC computation by ensuring byte orderAntonio Quartulli2014-02-171-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When computing the CRC on a 2byte variable the order of the bytes obviously alters the final result. This means that computing the CRC over the same value on two archs having different endianess leads to different numbers. The global and local translation table CRC computation routine makes this mistake while processing the clients VIDs. The result is a continuous CRC mismatching between nodes having different endianess. Fix this by converting the VID to Network Order before processing it. This guarantees that every node uses the same byte order. Introduced by 7ea7b4a142758deaf46c1af0ca9ceca6dd55138b ("batman-adv: make the TT CRC logic VLAN specific") Reported-by: Russel Senior <russell@personaltelco.net> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Tested-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
| * batman-adv: fix potential orig_node reference leakSimon Wunderlich2014-02-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Since batadv_orig_node_new() sets the refcount to two, assuming that the calling function will use a reference for putting the orig_node into a hash or similar, both references must be freed if initialization of the orig_node fails. Otherwise that object may be leaked in that error case. Reported-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
| * batman-adv: avoid potential race condition when adding a new neighbourAntonio Quartulli2014-02-173-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding a new neighbour it is important to atomically perform the following: - check if the neighbour already exists - append the neighbour to the proper list If the two operations are not performed in an atomic context it is possible that two concurrent insertions add the same neighbour twice. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
| * batman-adv: properly check pskb_may_pull return valueAntonio Quartulli2014-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | pskb_may_pull() returns 1 on success and 0 in case of failure, therefore checking for the return value being negative does not make sense at all. This way if the function fails we will probably read beyond the current skb data buffer. Fix this by doing the proper check. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
| * batman-adv: release vlan object after checking the CRCAntonio Quartulli2014-02-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a refcounter unbalance in the CRC checking routine invoked on OGM reception. A vlan object is retrieved (thus its refcounter is increased by one) but it is never properly released. This leads to a memleak because the vlan object will never be free'd. Fix this by releasing the vlan object after having read the CRC. Reported-by: Russell Senior <russell@personaltelco.net> Reported-by: Daniel <daniel@makrotopia.org> Reported-by: cmsv <cmsv@wirelesspt.net> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
| * batman-adv: fix TT-TVLV parsing on OGM receptionAntonio Quartulli2014-02-171-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When accessing a TT-TVLV container in the OGM RX path the variable pointing to the list of changes to apply is altered by mistake. This makes the TT component read data at the wrong position in the OGM packet buffer. Fix it by removing the bogus pointer alteration. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
| * batman-adv: fix soft-interface MTU computationAntonio Quartulli2014-02-171-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current MTU computation always returns a value smaller than 1500bytes even if the real interfaces have an MTU large enough to compensate the batman-adv overhead. Fix the computation by properly returning the highest admitted value. Introduced by a19d3d85e1b854e4a483a55d740a42458085560d ("batman-adv: limit local translation table max size") Reported-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | net: remove unnecessary return'sstephen hemminger2014-02-141-2/+0Star
|/ | | | | | | | | | | One of my pet coding style peeves is the practice of adding extra return; at the end of function. Kill several instances of this in network code. I suppose some coccinelle wizardy could do this automatically. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2014-01-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c net/ipv4/tcp_metrics.c Overlapping changes between the "don't create two tcp metrics objects with the same key" race fix in net and the addition of the destination address in the lookup key in net-next. Minor overlapping changes in bnx2x driver. Signed-off-by: David S. Miller <davem@davemloft.net>
| * batman-adv: fix batman-adv header overhead calculationMarek Lindner2014-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Batman-adv prepends a full ethernet header in addition to its own header. This has to be reflected in the MTU calculation, especially since the value is used to set dev->hard_header_len. Introduced by 411d6ed93a5d0601980d3e5ce75de07c98e3a7de ("batman-adv: consider network coding overhead when calculating required mtu") Reported-by: cmsv <cmsv@wirelesspt.net> Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-mergeDavid S. Miller2014-01-174-13/+31
|\ \ | | | | | | | | | | | | | | | | | | Included change: - properly format already existing kerneldoc Signed-off-by: David S. Miller <davem@davemloft.net>
| * | batman-adv: use consistent kerneldoc styleSimon Wunderlich2014-01-164-13/+31
| | | | | | | | | | | | | | | | | | | | | Reported-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | | Revert "batman-adv: drop dependency against CRC16"David S. Miller2014-01-161-0/+1
|/ / | | | | | | | | | | | | | | This reverts commit 12afc36e38b3b6a0ec9bda71632c2285e7fdbab2. The dependency is actually still necessary. Signed-off-by: David S. Miller <davem@davemloft.net>
* | batman-adv: use __dev_get_by_index instead of dev_get_by_index to find interfaceYing Xue2014-01-151-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following call chains indicate that batadv_is_on_batman_iface() is always under rtnl_lock protection as call_netdevice_notifier() is protected by rtnl_lock. So if __dev_get_by_index() rather than dev_get_by_index() is used to find interface handler in it, this would help us avoid to change interface reference counter. call_netdevice_notifier() batadv_hard_if_event() batadv_hardif_add_interface() batadv_is_valid_iface() batadv_is_on_batman_iface() Cc: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Ying Xue <ying.xue@windriver.com> Acked-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | batman-adv: drop dependency against CRC16Antonio Quartulli2014-01-121-1/+0Star
| | | | | | | | | | | | | | The crc16 functionality is not used anymore, therefore we can safely remove the dependency in the Kbuild file. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: Start new development cycleSimon Wunderlich2014-01-121-1/+1
| | | | | | | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: update copyright years for 2014Simon Wunderlich2014-01-1241-41/+41
| | | | | | | | | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: add build checks for packet sizesSimon Wunderlich2014-01-121-7/+17
| | | | | | | | | | | | | | | | | | | | | | With unrolling the batadv_header into the respective structures, the offsetof checks are now useless. Instead, add build checks for all packet types which go over the wire to avoid problems with wrong sizes or compatibility issues on some architectures which don't use every day. Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: remove returns at the end of void functionsAntonio Quartulli2014-01-121-7/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | Return at the end of void functions is not needed. Since most of the void functions in the code do not do so, make all the others consistent by removing the useless returns. Actually all the functions to be "fixed" are in network-coding.h only. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: add debugfs support to view multiif tablesSimon Wunderlich2014-01-125-7/+73
| | | | | | | | | | | | | | | | | | | | | | | | Show tables for the multi interface operation. Originator tables are added per hard interface. This patch also changes the API by adding the interface to the bat_orig_print() parameters. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: add debugfs structure for information per interfaceSimon Wunderlich2014-01-124-0/+86
| | | | | | | | | | | | | | | | | | | | To show information per interface, add a debugfs hardif structure similar to the system in sysfs. Hard interface folders will be created in "$debugfs/batman-adv/". Files are not yet added. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: add bonding againSimon Wunderlich2014-01-124-4/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | With the new interface alternating, the first hop may send packets in a round robin fashion to it's neighbors because it has multiple valid routes built by the multi interface optimization. This patch enables the feature if bonding is selected. Note that unlike the bonding implemented before, this version is much simpler and may even enable multi path routing to a certain degree. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: consider outgoing interface in OGM sendingSimon Wunderlich2014-01-123-64/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current OGM sending an aggregation functionality decides on which interfaces a packet should be sent when it parses the forward packet struct. However, with the network wide multi interface optimization the outgoing interface is decided by the OGM processing function. This is reflected by moving the decision in the OGM processing function and add the outgoing interface in the forwarding packet struct. This practically implies that an OGM may be added multiple times (once per outgoing interface), and this also affects aggregation which needs to consider the outgoing interface as well. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: add WiFi penaltySimon Wunderlich2014-01-123-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | If the same interface is used for sending and receiving, there might be throughput degradation on half-duplex interfaces such as WiFi. Add a penalty if the same interface is used to reflect this problem in the metric. At the same time, change the hop penalty from 30 to 15 so there will be no change for single wifi mesh network. the effective hop penalty will stay at 30 due to the new wifi penalty for these networks. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: split out router from orig_nodeSimon Wunderlich2014-01-1211-219/+605
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For the network wide multi interface optimization there are different routers for each outgoing interface (outgoing from the OGM perspective, incoming for payload traffic). To reflect this, change the router and associated data to a list of routers. While at it, rename batadv_orig_node_get_router() to batadv_orig_router_get() to follow the new naming scheme. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: split tq information in neigh_node structSimon Wunderlich2014-01-129-114/+588
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For the network wide multi interface optimization it is required to save metrics per outgoing interface in one neighbor. Therefore a new type is introduced to keep interface-specific information. This also requires some changes in access and list management. The compare and equiv_or_better API calls are changed to take the outgoing interface into consideration. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: remove bonding and interface alternatingSimon Wunderlich2014-01-125-327/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove bonding and interface alternating code - it will be replaced by a new, network-wide multi interface optimization which enables both bonding and interface alternating in a better way. Keep the sysfs and find router function though, this will be needed later. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* | batman-adv: set the isolation mark in the skb if neededAntonio Quartulli2014-01-083-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a broadcast packet is coming from a client marked as isolated, then mark the skb using the isolation mark so that netfilter (or any other application) can recognise them. The mark is written in the skb based on the mask value: only bits set in the mask are substitued by those in the mark value Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: create helper function to get AP isolation statusAntonio Quartulli2014-01-083-12/+28
| | | | | | | | | | | | | | | | The AP isolation status may be evaluated in different spots. Create an helper function to avoid code duplication. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: extend the ap_isolation mechanismAntonio Quartulli2014-01-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Change the AP isolation mechanism to not only "isolate" WIFI clients but also all those marked with the more generic "isolation flag" (BATADV_TT_CLIENT_ISOLA). The result is that when AP isolation is on any unicast packet originated by an "isolated" client and directed to another "isolated" client is dropped at the source node. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: print the new BATADV_TT_CLIENT_ISOLA flagAntonio Quartulli2014-01-081-4/+8
| | | | | | | | | | | | | | | | | | | | | | Print the new BATADV_TT_CLIENT_ISOLA flag properly in the Local and Global Translation Table output. The character 'I' is used in the flags column to indicate that the entry is marked as isolated. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: mark a local client as isolated when neededAntonio Quartulli2014-01-085-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A client sending packets which mark matches the value configured via sysfs has to be identified as isolated using the TT_CLIENT_ISOLA flag. The match is mask based, meaning that only bits set in the mask are compared with those in the mark value. If the configured mask is equal to 0 no operation is performed. Such flag is then advertised within the classic client announcement mechanism. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: add isolation_mark sysfs attributeAntonio Quartulli2014-01-083-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attribute can be used to set and read the value and the mask of the skb mark which will be used to classify the source non-mesh client as ISOLATED. In this way a client can be advertised as such and the mark can potentially be restored at the receiving node before delivering the skb. This can be helpful for creating network wide netfilter policies. This sysfs file expects a string of the shape "$mark/$mask". Where $mark has to be a 32-bit number in any base, while $mask must be a 32bit mask expressed in hex base. Only bits in $mark covered by the bitmask are really stored. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: send every DHCP packet as bat-unicastAntonio Quartulli2014-01-087-140/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In different situations it is possible that the DHCP server or client uses broadcast Ethernet frames to send messages to each other. The GW component in batman-adv takes care of using bat-unicast packets to bring broadcast DHCP Discover/Requests to the "best" server. On the way back the DHCP server usually sends unicasts, but upon client request it may decide to use broadcasts as well. This patch improves the GW component so that it now snoops and sends as unicast all the DHCP packets, no matter if they were generated by a DHCP server or client. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: remove parenthesis from return statementsAntonio Quartulli2014-01-081-1/+1
| | | | | | | | | | | | | | | | Remove parenthesis around return expression as suggested by checkpatch. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* | batman-adv: rename gw_deselect() to gw_reselect()Antonio Quartulli2014-01-084-18/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function batadv_gw_deselect() is actually not deselecting anything. It is just informing the GW code to perform a re-election procedure when possible. The current gateway is not being touched at all and therefore the name of this function is rather misleading. Rename it to batadv_gw_reselect() to batadv_gw_reselect() to make its behaviour easier to grasp. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>