Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bf47256 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge

Antonio Quartulli says:

====================
this is another batch intended for net-next/linux-3.13.

This pull request is a bit bigger than usual, but 6 patches are very small
(three of them are about email updates)..

Patch 1 is fixing a previous merge conflict resolution that went wrong
(I realised that only now while checking other patches..).
Patches from 2 to 4 that are updating our emails in all the proper files
(Documentation/, headers and MAINTAINERS).

Patches 5, 6 and 7 are bringing a big improvement to the TranslationTable
component: it is now able to group non-mesh clients based on the VLAN they
belong to. In this way a lot a new enhancements are now possible thanks to the
fact that each batman-adv behaviour can be applied on a per VLAN basis.

And, of course, in patches from 8 to 12 you have some of the enhancements I was
talking about:
- make the batman-Gateway selection VLAN dependent
- make DAT (Distributed ARP Table) group ARP entries on a VLAN basis (this
  allows DAT to work even when the admin decided to use the same IP subnet on
  different VLANs)
- make the AP-Isolation behaviour switchable on each VLAN independently
- export VLAN specific attributes via sysfs. Switches like the AP-Isolation are
  now exported once per VLAN (backward compatibility of the sysfs interface has
  been preserved)

Patches 13 and 14 are small code cleanups.
Patch 15 is a minor improvement in the TT locking mechanism.

Patches 16 and 17 are other enhancements to the TT component. Those allow a
node to parse a "non-mesh client announcement message" and accept only those
TT entries belonging to certain VLANs.

Patch 18 exploits this parse&accept mechanism to make the Bridge Loop Avoidance
component reject only TT entries connected to the VLAN where it is operating.
Previous to this change, BLA was rejecting all the entries coming from any other
Backbone node, regardless of the VLAN (for more details about how the Bridge
Loop Avoidance works please check [1]).

[1] http://www.open-mesh.org/projects/batman-adv/wiki/Bridge-loop-avoidance-II


====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7dcade39 cfd4f757
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line


What:           /sys/class/net/<iface>/batman-adv/iface_status
What:           /sys/class/net/<iface>/batman-adv/iface_status
Date:           May 2010
Date:           May 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                Indicates the status of <iface> as it is seen by batman.
                Indicates the status of <iface> as it is seen by batman.


What:           /sys/class/net/<iface>/batman-adv/mesh_iface
What:           /sys/class/net/<iface>/batman-adv/mesh_iface
Date:           May 2010
Date:           May 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                The /sys/class/net/<iface>/batman-adv/mesh_iface file
                The /sys/class/net/<iface>/batman-adv/mesh_iface file
                displays the batman mesh interface this <iface>
                displays the batman mesh interface this <iface>
+12 −11
Original line number Original line Diff line number Diff line


What:           /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
What:           /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
Date:           May 2010
Date:           May 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                Indicates whether the batman protocol messages of the
                Indicates whether the batman protocol messages of the
                mesh <mesh_iface> shall be aggregated or not.
                mesh <mesh_iface> shall be aggregated or not.


What:           /sys/class/net/<mesh_iface>/mesh/ap_isolation
What:           /sys/class/net/<mesh_iface>/mesh/<vlan_subdir>/ap_isolation
Date:           May 2011
Date:           May 2011
Contact:        Antonio Quartulli <ordex@autistici.org>
Contact:        Antonio Quartulli <antonio@meshcoding.com>
Description:
Description:
                Indicates whether the data traffic going from a
                Indicates whether the data traffic going from a
                wireless client to another wireless client will be
                wireless client to another wireless client will be
                silently dropped.
                silently dropped. <vlan_subdir> is empty when referring
		to the untagged lan.


What:           /sys/class/net/<mesh_iface>/mesh/bonding
What:           /sys/class/net/<mesh_iface>/mesh/bonding
Date:           June 2010
Date:           June 2010
Contact:        Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Contact:        Simon Wunderlich <sw@simonwunderlich.de>
Description:
Description:
                Indicates whether the data traffic going through the
                Indicates whether the data traffic going through the
                mesh will be sent using multiple interfaces at the
                mesh will be sent using multiple interfaces at the
@@ -24,7 +25,7 @@ Description:


What:           /sys/class/net/<mesh_iface>/mesh/bridge_loop_avoidance
What:           /sys/class/net/<mesh_iface>/mesh/bridge_loop_avoidance
Date:           November 2011
Date:           November 2011
Contact:        Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Contact:        Simon Wunderlich <sw@simonwunderlich.de>
Description:
Description:
                Indicates whether the bridge loop avoidance feature
                Indicates whether the bridge loop avoidance feature
                is enabled. This feature detects and avoids loops
                is enabled. This feature detects and avoids loops
@@ -41,21 +42,21 @@ Description:


What:           /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
What:           /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
Date:           October 2010
Date:           October 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                Defines the bandwidth which is propagated by this
                Defines the bandwidth which is propagated by this
                node if gw_mode was set to 'server'.
                node if gw_mode was set to 'server'.


What:           /sys/class/net/<mesh_iface>/mesh/gw_mode
What:           /sys/class/net/<mesh_iface>/mesh/gw_mode
Date:           October 2010
Date:           October 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                Defines the state of the gateway features. Can be
                Defines the state of the gateway features. Can be
                either 'off', 'client' or 'server'.
                either 'off', 'client' or 'server'.


What:           /sys/class/net/<mesh_iface>/mesh/gw_sel_class
What:           /sys/class/net/<mesh_iface>/mesh/gw_sel_class
Date:           October 2010
Date:           October 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                Defines the selection criteria this node will use
                Defines the selection criteria this node will use
                to choose a gateway if gw_mode was set to 'client'.
                to choose a gateway if gw_mode was set to 'client'.
@@ -77,14 +78,14 @@ Description:


What:           /sys/class/net/<mesh_iface>/mesh/orig_interval
What:           /sys/class/net/<mesh_iface>/mesh/orig_interval
Date:           May 2010
Date:           May 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                Defines the interval in milliseconds in which batman
                Defines the interval in milliseconds in which batman
                sends its protocol messages.
                sends its protocol messages.


What:           /sys/class/net/<mesh_iface>/mesh/routing_algo
What:           /sys/class/net/<mesh_iface>/mesh/routing_algo
Date:           Dec 2011
Date:           Dec 2011
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <mareklindner@neomailbox.ch>
Description:
Description:
                Defines the routing procotol this mesh instance
                Defines the routing procotol this mesh instance
                uses to find the optimal paths through the mesh.
                uses to find the optimal paths through the mesh.
+2 −2
Original line number Original line Diff line number Diff line
@@ -199,5 +199,5 @@ Mailing-list: b.a.t.m.a.n@open-mesh.org (optional subscription


You can also contact the Authors:
You can also contact the Authors:


Marek  Lindner  <lindner_marek@yahoo.de>
Marek  Lindner  <mareklindner@neomailbox.ch>
Simon  Wunderlich  <siwu@hrz.tu-chemnitz.de>
Simon  Wunderlich  <sw@simonwunderlich.de>
+1 −1
Original line number Original line Diff line number Diff line
@@ -1653,7 +1653,7 @@ F: include/linux/backlight.h


BATMAN ADVANCED
BATMAN ADVANCED
M:	Marek Lindner <mareklindner@neomailbox.ch>
M:	Marek Lindner <mareklindner@neomailbox.ch>
M:	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
M:	Simon Wunderlich <sw@simonwunderlich.de>
M:	Antonio Quartulli <antonio@meshcoding.com>
M:	Antonio Quartulli <antonio@meshcoding.com>
L:	b.a.t.m.a.n@lists.open-mesh.org
L:	b.a.t.m.a.n@lists.open-mesh.org
W:	http://www.open-mesh.org/
W:	http://www.open-mesh.org/
+24 −34
Original line number Original line Diff line number Diff line
@@ -411,10 +411,10 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, uint8_t *orig,
		return NULL;
		return NULL;
	}
	}


	/* this is a gateway now, remove any tt entries */
	/* this is a gateway now, remove any TT entry on this VLAN */
	orig_node = batadv_orig_hash_find(bat_priv, orig);
	orig_node = batadv_orig_hash_find(bat_priv, orig);
	if (orig_node) {
	if (orig_node) {
		batadv_tt_global_del_orig(bat_priv, orig_node,
		batadv_tt_global_del_orig(bat_priv, orig_node, vid,
					  "became a backbone gateway");
					  "became a backbone gateway");
		batadv_orig_node_free_ref(orig_node);
		batadv_orig_node_free_ref(orig_node);
	}
	}
@@ -858,27 +858,25 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv,
				    struct batadv_hard_iface *primary_if,
				    struct batadv_hard_iface *primary_if,
				    struct sk_buff *skb)
				    struct sk_buff *skb)
{
{
	struct ethhdr *ethhdr;
	struct batadv_bla_claim_dst *bla_dst;
	uint8_t *hw_src, *hw_dst;
	struct vlan_ethhdr *vhdr;
	struct vlan_ethhdr *vhdr;
	struct ethhdr *ethhdr;
	struct arphdr *arphdr;
	struct arphdr *arphdr;
	uint8_t *hw_src, *hw_dst;
	unsigned short vid;
	struct batadv_bla_claim_dst *bla_dst;
	__be16 proto;
	__be16 proto;
	int headlen;
	int headlen;
	unsigned short vid = BATADV_NO_FLAGS;
	int ret;
	int ret;


	vid = batadv_get_vid(skb, 0);
	ethhdr = eth_hdr(skb);
	ethhdr = eth_hdr(skb);


	if (ethhdr->h_proto == htons(ETH_P_8021Q)) {
		vhdr = (struct vlan_ethhdr *)ethhdr;
		vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;
		vid |= BATADV_VLAN_HAS_TAG;
		proto = vhdr->h_vlan_encapsulated_proto;
		headlen = sizeof(*vhdr);
	} else {
	proto = ethhdr->h_proto;
	proto = ethhdr->h_proto;
	headlen = ETH_HLEN;
	headlen = ETH_HLEN;
	if (vid & BATADV_VLAN_HAS_TAG) {
		vhdr = (struct vlan_ethhdr *)ethhdr;
		proto = vhdr->h_vlan_encapsulated_proto;
		headlen += VLAN_HLEN;
	}
	}


	if (proto != htons(ETH_P_ARP))
	if (proto != htons(ETH_P_ARP))
@@ -1317,12 +1315,14 @@ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,


/* @bat_priv: the bat priv with all the soft interface information
/* @bat_priv: the bat priv with all the soft interface information
 * @orig: originator mac address
 * @orig: originator mac address
 * @vid: VLAN identifier
 *
 *
 * check if the originator is a gateway for any VLAN ID.
 * Check if the originator is a gateway for the VLAN identified by vid.
 *
 *
 * returns 1 if it is found, 0 otherwise
 * Returns true if orig is a backbone for this vid, false otherwise.
 */
 */
int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig)
bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig,
				    unsigned short vid)
{
{
	struct batadv_hashtable *hash = bat_priv->bla.backbone_hash;
	struct batadv_hashtable *hash = bat_priv->bla.backbone_hash;
	struct hlist_head *head;
	struct hlist_head *head;
@@ -1330,25 +1330,26 @@ int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig)
	int i;
	int i;


	if (!atomic_read(&bat_priv->bridge_loop_avoidance))
	if (!atomic_read(&bat_priv->bridge_loop_avoidance))
		return 0;
		return false;


	if (!hash)
	if (!hash)
		return 0;
		return false;


	for (i = 0; i < hash->size; i++) {
	for (i = 0; i < hash->size; i++) {
		head = &hash->table[i];
		head = &hash->table[i];


		rcu_read_lock();
		rcu_read_lock();
		hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
		hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
			if (batadv_compare_eth(backbone_gw->orig, orig)) {
			if (batadv_compare_eth(backbone_gw->orig, orig) &&
			    backbone_gw->vid == vid) {
				rcu_read_unlock();
				rcu_read_unlock();
				return 1;
				return true;
			}
			}
		}
		}
		rcu_read_unlock();
		rcu_read_unlock();
	}
	}


	return 0;
	return false;
}
}




@@ -1365,10 +1366,8 @@ int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig)
int batadv_bla_is_backbone_gw(struct sk_buff *skb,
int batadv_bla_is_backbone_gw(struct sk_buff *skb,
			      struct batadv_orig_node *orig_node, int hdr_size)
			      struct batadv_orig_node *orig_node, int hdr_size)
{
{
	struct ethhdr *ethhdr;
	struct vlan_ethhdr *vhdr;
	struct batadv_bla_backbone_gw *backbone_gw;
	struct batadv_bla_backbone_gw *backbone_gw;
	unsigned short vid = BATADV_NO_FLAGS;
	unsigned short vid;


	if (!atomic_read(&orig_node->bat_priv->bridge_loop_avoidance))
	if (!atomic_read(&orig_node->bat_priv->bridge_loop_avoidance))
		return 0;
		return 0;
@@ -1377,16 +1376,7 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb,
	if (!pskb_may_pull(skb, hdr_size + ETH_HLEN))
	if (!pskb_may_pull(skb, hdr_size + ETH_HLEN))
		return 0;
		return 0;


	ethhdr = (struct ethhdr *)(((uint8_t *)skb->data) + hdr_size);
	vid = batadv_get_vid(skb, hdr_size);

	if (ethhdr->h_proto == htons(ETH_P_8021Q)) {
		if (!pskb_may_pull(skb, hdr_size + VLAN_ETH_HLEN))
			return 0;

		vhdr = (struct vlan_ethhdr *)(skb->data + hdr_size);
		vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;
		vid |= BATADV_VLAN_HAS_TAG;
	}


	/* see if this originator is a backbone gw for this VLAN */
	/* see if this originator is a backbone gw for this VLAN */
	backbone_gw = batadv_backbone_hash_find(orig_node->bat_priv,
	backbone_gw = batadv_backbone_hash_find(orig_node->bat_priv,
Loading