Consider the following situation which has been found in a test setup:
Gateway B has claimed client C and gateway A has the same backbone
network as B. C sends a broad- or multicast to B and directly after
this packet decides to send another packet to A due to a better TQ
value. B will forward the broad-/multicast into the backbone as it is
the responsible gw and after that A will claim C as it has been
chosen by C as the new gateway. If it now happens that A claims C
before it has received the broad-/multicast forwarded by B (due to
backbone topology or due to some delay in B when forwarding the
packet) we get a critical situation: in the current code A will
immediately unclaim C when receiving the multicast due to the
roaming client scenario although the position of C has not changed
in the mesh. If this happens the multi-/broadcast forwarded by B
will be sent back into the mesh by A and we have looping packets
until one of the gateways claims C again.
In order to prevent this, unclaiming of a client due to the roaming
client scenario is only done after a certain time is expired after
the last claim of the client. 100 ms are used here, which should be
slow enough for big backbones and slow gateways but fast enough not
to break the roaming client use case.
Signed-off-by: Andreas Pape <apape(a)phoenixcontact.com>
---
net/batman-adv/bridge_loop_avoidance.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 32a6168..98f0dd9 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1764,10 +1764,22 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
/* if yes, the client has roamed and we have
* to unclaim it.
*/
- batadv_handle_unclaim(bat_priv, primary_if,
- primary_if->net_dev->dev_addr,
- ethhdr->h_source, vid);
- goto allow;
+ if (batadv_has_timed_out(claim->lasttime, 100)) {
+ /* only unclaim if the last claim entry is
+ * older than 100 ms to make sure we really
+ * have a roaming client here.
+ */
+ batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla_tx(): Roaming client %pM detected. Unclaim it.\n",
+ ethhdr->h_source);
+ batadv_handle_unclaim(bat_priv, primary_if,
+ primary_if->net_dev->dev_addr,
+ ethhdr->h_source, vid);
+ goto allow;
+ } else {
+ batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla_tx(): Race for claim %pM detected. Drop packet.\n",
+ ethhdr->h_source);
+ goto handled;
+ }
}
/* check if it is a multicast/broadcast frame */
--
1.7.0.4
..................................................................
PHOENIX CONTACT ELECTRONICS GmbH
Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Roland Bent, Dr. Martin Heubeck
___________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________
If dat is enabled it must be made sure that only the backbone gw which has
claimed the remote destination for the ARP request answers the ARP request
directly if the MAC address is known due to the local dat table. This
prevents multiple ARP replies in a common backbone if more than one
gateway already knows the remote mac searched for in the ARP request.
Signed-off-by: Andreas Pape <apape(a)phoenixcontact.com>
---
net/batman-adv/bridge_loop_avoidance.c | 59 ++++++++++++++++++++++++++++++++
net/batman-adv/bridge_loop_avoidance.h | 9 +++++
net/batman-adv/distributed-arp-table.c | 15 ++++++++
3 files changed, 83 insertions(+), 0 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 0a6c8b8..07dba86 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1906,3 +1906,62 @@ out:
batadv_hardif_put(primary_if);
return 0;
}
+
+/**
+ * batadv_bla_handle_local_claim - check if address is claimed and claim it
+ * if it isn't
+ * @bat_priv: the bat priv with all the soft interface information
+ * @addr: mac address of which the claim status is checked
+ * @vid: the VLAN ID
+ *
+ * addr is checked if this address is claimed by the local device itself.
+ * If the address is not claimed at all, claim it.
+ *
+ * Return: true if bla is disabled or the mac is claimed by the device,
+ * false if the device addr is already claimed by another gateway
+ */
+bool batadv_bla_handle_local_claim(struct batadv_priv *bat_priv,
+ u8 *addr, unsigned short vid)
+{
+ struct batadv_bla_claim search_claim;
+ struct batadv_bla_claim *claim = NULL;
+ struct batadv_hard_iface *primary_if = NULL;
+ bool ret = true;
+
+ if (!atomic_read(&bat_priv->bridge_loop_avoidance))
+ return ret;
+
+ primary_if = batadv_primary_if_get_selected(bat_priv);
+ if (!primary_if)
+ goto out;
+
+ /* First look if the mac address is claimed */
+ ether_addr_copy(search_claim.addr, addr);
+ search_claim.vid = vid;
+
+ claim = batadv_claim_hash_find(bat_priv, &search_claim);
+
+ /* If there is a claim and we are not owner of the claim,
+ * return false;
+ */
+ if (claim) {
+ if (!batadv_compare_eth(claim->backbone_gw->orig,
+ primary_if->net_dev->dev_addr))
+ ret = false;
+ } else {
+ /* If there is no claim, claim the device */
+ batadv_dbg(BATADV_DBG_BLA, bat_priv,
+ "Handle claim locally for currently not claimed mac %pM.\n",
+ search_claim.addr);
+
+ batadv_handle_claim(bat_priv, primary_if,
+ primary_if->net_dev->dev_addr, addr, vid);
+ }
+
+out:
+ if (claim)
+ batadv_claim_put(claim);
+ if (primary_if)
+ batadv_hardif_put(primary_if);
+ return ret;
+}
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h
index 579f0fa..ddf6b9d 100644
--- a/net/batman-adv/bridge_loop_avoidance.h
+++ b/net/batman-adv/bridge_loop_avoidance.h
@@ -46,6 +46,8 @@ void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
void batadv_bla_status_update(struct net_device *net_dev);
int batadv_bla_init(struct batadv_priv *bat_priv);
void batadv_bla_free(struct batadv_priv *bat_priv);
+bool batadv_bla_handle_local_claim(struct batadv_priv *bat_priv, u8 *addr,
+ unsigned short vid);
#define BATADV_BLA_CRC_INIT 0
#else /* ifdef CONFIG_BATMAN_ADV_BLA */
@@ -111,6 +113,13 @@ static inline void batadv_bla_free(struct batadv_priv *bat_priv)
{
}
+static inline
+bool batadv_bla_handle_local_claim(struct batadv_priv *bat_priv, u8 *addr,
+ unsigned short vid)
+{
+ return true;
+}
+
#endif /* ifdef CONFIG_BATMAN_ADV_BLA */
#endif /* ifndef _NET_BATMAN_ADV_BLA_H_ */
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index e96d7c7..a9152e7 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -48,6 +48,7 @@
#include "originator.h"
#include "send.h"
#include "translation-table.h"
+#include "bridge_loop_avoidance.h"
static void batadv_dat_purge(struct work_struct *work);
@@ -1000,6 +1001,20 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
goto out;
}
+ /* If BLA is enabled, only send ARP replies if we have claimed
+ * the destination for the ARP request or if no one else of
+ * the backbone gws belonging to our backbone has claimed the
+ * destination.
+ */
+ if (!batadv_bla_handle_local_claim(bat_priv,
+ dat_entry->mac_addr, vid)) {
+ batadv_dbg(BATADV_DBG_DAT, bat_priv,
+ "Device %pM claimed by another backbone gw. Don't send ARP reply!",
+ dat_entry->mac_addr);
+ ret = true;
+ goto out;
+ }
+
skb_new = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_src,
bat_priv->soft_iface, ip_dst, hw_src,
dat_entry->mac_addr, hw_src);
--
1.7.0.4
..................................................................
PHOENIX CONTACT ELECTRONICS GmbH
Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Roland Bent, Dr. Martin Heubeck
___________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________
The batadv_tt_local_entry was specific to a batadv_softif_vlan and held an
implicit reference to it. But this reference was never stored in form of a
pointer in the tt_local_entry itself. Instead batadv_tt_local_remove,
batadv_tt_local_table_free and batadv_tt_local_purge_pending_clients depend
on a consistent state of bat_priv->softif_vlan_list and that
batadv_softif_vlan_get always returns the batadv_softif_vlan object which
it has a reference for. But batadv_softif_vlan_get cannot guarantee that
because it is working only with rcu_read_lock on this list. It can
therefore happen that an vid is in this list twice or that
batadv_softif_vlan_get cannot find the batadv_softif_vlan for an vid due to
some other list operations taking place at the same time.
Instead add a batadv_softif_vlan pointer directly in batadv_tt_local_entry
which will be used for the reference counter decremented on release of
batadv_tt_local_entry.
Fixes: 9729d2085c0f ("batman-adv: fix TT VLAN inconsistency on VLAN re-add")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
See https://www.open-mesh.org/issues/243
net/batman-adv/translation-table.c | 30 +++++++++++++++++++++---------
net/batman-adv/types.h | 2 ++
2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 2ed55f4..8b89c8f 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -215,6 +215,9 @@ static void batadv_tt_local_entry_release(struct kref *ref)
tt_local_entry = container_of(ref, struct batadv_tt_local_entry,
common.refcount);
+ if (tt_local_entry->vlan)
+ batadv_softif_vlan_put(tt_local_entry->vlan);
+
kfree_rcu(tt_local_entry, common.rcu);
}
@@ -673,6 +676,7 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr,
kref_get(&tt_local->common.refcount);
tt_local->last_seen = jiffies;
tt_local->common.added_at = tt_local->last_seen;
+ tt_local->vlan = vlan;
/* the batman interface mac and multicast addresses should never be
* purged
@@ -991,7 +995,6 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
struct batadv_tt_common_entry *tt_common_entry;
struct batadv_tt_local_entry *tt_local;
struct batadv_hard_iface *primary_if;
- struct batadv_softif_vlan *vlan;
struct hlist_head *head;
unsigned short vid;
u32 i;
@@ -1028,8 +1031,7 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
no_purge = tt_common_entry->flags & np_flag;
- vlan = batadv_softif_vlan_get(bat_priv, vid);
- if (!vlan) {
+ if (!tt_local->vlan) {
seq_printf(seq, "Cannot retrieve VLAN %d\n",
BATADV_PRINT_VID(vid));
continue;
@@ -1052,9 +1054,7 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'),
no_purge ? 0 : last_seen_secs,
no_purge ? 0 : last_seen_msecs,
- vlan->tt.crc);
-
- batadv_softif_vlan_put(vlan);
+ tt_local->vlan->tt.crc);
}
rcu_read_unlock();
}
@@ -1099,7 +1099,6 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,
{
struct batadv_tt_local_entry *tt_local_entry;
u16 flags, curr_flags = BATADV_NO_FLAGS;
- struct batadv_softif_vlan *vlan;
void *tt_entry_exists;
tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);
@@ -1139,6 +1138,10 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,
/* extra call to free the local tt entry */
batadv_tt_local_entry_put(tt_local_entry);
+#if 0
+ /* THIS IS BAD BECAUSE THIS MAY NOT BE THE REAL OBJECT THIS
+ * tt_local_entry HAS THE REFERENCE FOR
+ */
/* decrease the reference held for this vlan */
vlan = batadv_softif_vlan_get(bat_priv, vid);
if (!vlan)
@@ -1146,6 +1149,7 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,
batadv_softif_vlan_put(vlan);
batadv_softif_vlan_put(vlan);
+#endif
out:
if (tt_local_entry)
@@ -1219,7 +1223,6 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
spinlock_t *list_lock; /* protects write access to the hash lists */
struct batadv_tt_common_entry *tt_common_entry;
struct batadv_tt_local_entry *tt_local;
- struct batadv_softif_vlan *vlan;
struct hlist_node *node_tmp;
struct hlist_head *head;
u32 i;
@@ -1241,6 +1244,10 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
struct batadv_tt_local_entry,
common);
+#if 0
+ /* THIS IS BAD BECAUSE THIS MAY NOT BE THE REAL OBJECT THIS
+ * tt_local HAS THE REFERENCE FOR
+ */
/* decrease the reference held for this vlan */
vlan = batadv_softif_vlan_get(bat_priv,
tt_common_entry->vid);
@@ -1248,6 +1255,7 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
batadv_softif_vlan_put(vlan);
batadv_softif_vlan_put(vlan);
}
+#endif
batadv_tt_local_entry_put(tt_local);
}
@@ -3310,7 +3318,6 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
struct batadv_hashtable *hash = bat_priv->tt.local_hash;
struct batadv_tt_common_entry *tt_common;
struct batadv_tt_local_entry *tt_local;
- struct batadv_softif_vlan *vlan;
struct hlist_node *node_tmp;
struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */
@@ -3340,12 +3347,17 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
struct batadv_tt_local_entry,
common);
+#if 0
+ /* THIS IS BAD BECAUSE THIS MAY NOT BE THE REAL OBJECT THIS
+ * tt_local_entry HAS THE REFERENCE FOR
+ */
/* decrease the reference held for this vlan */
vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid);
if (vlan) {
batadv_softif_vlan_put(vlan);
batadv_softif_vlan_put(vlan);
}
+#endif
batadv_tt_local_entry_put(tt_local);
}
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 9abfb3e..1480538 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1073,10 +1073,12 @@ struct batadv_tt_common_entry {
* struct batadv_tt_local_entry - translation table local entry data
* @common: general translation table data
* @last_seen: timestamp used for purging stale tt local entries
+ * @vlan: soft-interface vlan of the entry
*/
struct batadv_tt_local_entry {
struct batadv_tt_common_entry common;
unsigned long last_seen;
+ struct batadv_softif_vlan *vlan;
};
/**
--
2.7.0
Hi
I'm sometimes getting a crash after removing a hard interface when the
batadv_send_outstanding_bat_org_packet() is called in a work queue.
It calls
static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
int packet_len, unsigned long send_time,
bool direct_link,
struct batadv_hard_iface *if_incoming,
struct batadv_hard_iface *if_outgoing,
int own_packet)
{
struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct batadv_forw_packet *forw_packet_aggr;
unsigned char *skb_buff;
unsigned int skb_size;
if (!kref_get_unless_zero(&if_incoming->refcount))
return;
if (!kref_get_unless_zero(&if_outgoing->refcount))
goto out_free_incoming;
Given that we have:
static inline void batadv_hardif_put(struct batadv_hard_iface *hard_iface)
{
kref_put(&hard_iface->refcount, batadv_hardif_release);
}
does using kref_get_unless_zero() make sense? If it is zero, hasn't it
been freed by the kref_put that set it to zero?
Thanks
Andrew
The driver calls cfg80211_get_station, which may be part of a
module, so we must not enable BATMAN_ADV_BATMAN_V if
BATMAN_ADV=y and CFG80211=m:
net/built-in.o: In function `batadv_v_elp_get_throughput':
(text+0x5c62c): undefined reference to `cfg80211_get_station'
This clarifies the dependency to cover all combinations.
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Fixes: c833484e5f38 ("batman-adv: ELP - compute the metric based on the estimated throughput")
---
net/batman-adv/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index e651dc927bfd..f66930ee3c0b 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -17,7 +17,7 @@ config BATMAN_ADV
config BATMAN_ADV_BATMAN_V
bool "B.A.T.M.A.N. V protocol (experimental)"
- depends on BATMAN_ADV && CFG80211
+ depends on BATMAN_ADV && CFG80211=y || (CFG80211=m && BATMAN_ADV=m)
default n
help
This option enables the B.A.T.M.A.N. V protocol, the successor
--
2.7.0
Speeding up dat address lookup is achieved by snooping all incoming ip
traffic. This especially increases the propability in bla setups that
a gateway into a common backbone network already has a fitting dat entry
to answer incoming ARP requests directly coming from the backbone
network thus further reducing ARP traffic in the mesh.
Signed-off-by: Andreas Pape <apape(a)phoenixcontact.com>
---
net/batman-adv/distributed-arp-table.c | 18 ++++++++++++++++++
net/batman-adv/distributed-arp-table.h | 9 ++++++++-
net/batman-adv/soft-interface.c | 22 +++++++++++++++++++++-
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index a9152e7..0f899b9 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -362,6 +362,24 @@ out:
batadv_dat_entry_put(dat_entry);
}
+/**
+ * batadv_dat_entry_check - check and update a dat entry
+ * @bat_priv: the bat priv with all the soft interface information
+ * @ip: ipv4 to add/edit
+ * @mac_addr: mac address to assign to the given ipv4
+ * @vid: VLAN identifier
+ *
+ * checks additionally, if dat is enabled. can be called from other modules.
+ */
+void batadv_dat_entry_check(struct batadv_priv *bat_priv, __be32 ip,
+ u8 *mac_addr, unsigned short vid)
+{
+ if (!atomic_read(&bat_priv->distributed_arp_table))
+ return;
+
+ batadv_dat_entry_add(bat_priv, ip, mac_addr, vid);
+}
+
#ifdef CONFIG_BATMAN_ADV_DEBUG
/**
diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h
index 813ecea..e1b4848 100644
--- a/net/batman-adv/distributed-arp-table.h
+++ b/net/batman-adv/distributed-arp-table.h
@@ -80,7 +80,8 @@ batadv_dat_init_own_addr(struct batadv_priv *bat_priv,
int batadv_dat_init(struct batadv_priv *bat_priv);
void batadv_dat_free(struct batadv_priv *bat_priv);
int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset);
-
+void batadv_dat_entry_check(struct batadv_priv *bat_priv, __be32 ip,
+ u8 *mac_addr, unsigned short vid);
/**
* batadv_dat_inc_counter - increment the correct DAT packet counter
* @bat_priv: the bat priv with all the soft interface information
@@ -173,6 +174,12 @@ static inline void batadv_dat_inc_counter(struct batadv_priv *bat_priv,
{
}
+static inline
+void batadv_dat_entry_check(struct batadv_priv *bat_priv, __be32 ip,
+ u8 *mac_addr, unsigned short vid)
+{
+}
+
#endif /* CONFIG_BATMAN_ADV_DAT */
#endif /* _NET_BATMAN_ADV_DISTRIBUTED_ARP_TABLE_H_ */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 0710379..f031781 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -28,6 +28,7 @@
#include <linux/fs.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
+#include <linux/ip.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/kref.h>
@@ -390,6 +391,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
__be16 ethertype = htons(ETH_P_BATMAN);
struct vlan_ethhdr *vhdr;
struct ethhdr *ethhdr;
+ struct iphdr *iphdr;
unsigned short vid;
bool is_bcast;
@@ -412,11 +414,29 @@ void batadv_interface_rx(struct net_device *soft_iface,
ethhdr = eth_hdr(skb);
switch (ntohs(ethhdr->h_proto)) {
+ case ETH_P_IP:
+ iphdr = (struct iphdr *)(skb->data + ETH_HLEN);
+ /* snoop incoming traffic for dat update using the source mac
+ * and source ip to speed up dat.
+ */
+ batadv_dat_entry_check(bat_priv, iphdr->saddr,
+ ethhdr->h_source, vid);
+ break;
case ETH_P_8021Q:
vhdr = (struct vlan_ethhdr *)skb->data;
- if (vhdr->h_vlan_encapsulated_proto != ethertype)
+ if (vhdr->h_vlan_encapsulated_proto != ethertype) {
+ /* snoop incoming traffic for dat update also for vlan
+ * tagged frames.
+ */
+ if (vhdr->h_vlan_encapsulated_proto == ETH_P_IP) {
+ iphdr = (struct iphdr *)(vhdr +
+ sizeof(struct vlan_ethhdr));
+ batadv_dat_entry_check(bat_priv, iphdr->saddr,
+ vhdr->h_source, vid);
+ }
break;
+ }
/* fall through */
case ETH_P_BATMAN:
--
1.7.0.4
..................................................................
PHOENIX CONTACT ELECTRONICS GmbH
Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Roland Bent, Dr. Martin Heubeck
___________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________
Hello David,
this is our (hopefully) latest batch of patches intended for net-next.
With this patchset we finally introduce B.A.T.M.A.N. V: the latest
version of our routing protocol.
Technical documentation describing the protocol in more detail can
be found in our wiki[1][2][3][4].
For what concerns this pull request, you can find the high level
description right below.
Please pull or let me know of any problem!
Thank you very much,
Antonio
[1] https://www.open-mesh.org/projects/batman-adv/wiki/BATMAN_V
[2] https://www.open-mesh.org/projects/batman-adv/wiki/OGMv2
[3] https://www.open-mesh.org/projects/batman-adv/wiki/ELP
[4] https://www.open-mesh.org/projects/batman-adv/wiki/BATMAN_V_Tests
The following changes since commit f12d33f4d83c6837d176e1aef337914089c77957:
3c59x: Ensure to apply the expires time (2016-02-28 23:39:26 -0500)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-for-davem
for you to fetch changes up to 8b823170550e5dcc80512143088c9f9e24598f9a:
MAINTAINERS: Add patchwork URL for BATMAN ADVANCED (2016-02-29 16:25:09 +0800)
----------------------------------------------------------------
With this patchset we finally introduce our new routing protocol:
B.A.T.M.A.N. V. Its implementation started quite some years ago,
but due to the big changes being introduced it took a while to be
discussed, designed, worked, re-worked, tested and debugged (well,
we're never done with the latest). The entire operation has
basically been a team work involving all the core contributors
together with other people interested in the project.
The new protocol is divided into two main subcomponents, called
respectively ELP and OGMv2. The former is in charge of
dealing with the neighbour discovery and link quality estimation,
while the latter implements the algorithm that spreads the
metrics around the network and computes optimal paths.
The biggest change introduced with B.A.T.M.A.N. V is the new
metric: the protocol won't rely on packet loss anymore, but it
will use the estimated throughput extracted directly from the
wifi driver (when available) by querying cfg80211.
Batman-adv will also send some unicast probing packets when
an interface is not used for payload traffic to make sure that
such values are current.
The new protocol can be compiled-in or not like other
features we have and when selected will pull in CFG80211 as
dependency for the reason described above.
Thanks to the big work brought up in the past by Marek Lindner,
batman-adv can easily deal several protocol implementations,
therefore compiling in this new version does not exclude the
older.
This means that the user is offered the option to choose
the protocol when creating the mesh interface (default is the
old one to keep backward compatibility).
Along with the protocol there are some sysfs knobs that are
introduced to fine tune some of its behaviours, but users
are recommended to keep the default values unless they know
what they are doing.
The last patch is about advertising our own patchwork platform
(thanks to Sven Eckelmann for having set that up!) in the
MAINTAINERS file.
----------------------------------------------------------------
Antonio Quartulli (8):
batman-adv: OGMv2 - add basic infrastructure
batman-adv: OGMv2 - implement originators logic
batman-adv: add throughput override attribute to hard_ifaces
batman-adv: keep track of when unicast packets are sent
batman-adv: ELP - compute the metric based on the estimated throughput
batman-adv: ELP - send unicast ELP packets for throughput sampling
batman-adv: B.A.T.M.A.N. V - implement neighbor comparison API calls
batman-adv: B.A.T.M.A.N. V - implement bat_orig_print API
Linus Luessing (5):
batman-adv: Add hard_iface specific sysfs wrapper macros for UINT
batman-adv: ELP - adding basic infrastructure
batman-adv: ELP - creating neighbor structures
batman-adv: ELP - adding sysfs parameter for elp interval
batman-adv: B.A.T.M.A.N. V - implement bat_neigh_print API
Simon Wunderlich (1):
batman-adv: Start new development cycle
Sven Eckelmann (1):
MAINTAINERS: Add patchwork URL for BATMAN ADVANCED
.../ABI/testing/sysfs-class-net-batman-adv | 17 +-
MAINTAINERS | 1 +
net/batman-adv/Kconfig | 14 +
net/batman-adv/Makefile | 3 +
net/batman-adv/bat_algo.h | 28 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/batman-adv/bat_v.c | 347 +++++++++
net/batman-adv/bat_v_elp.c | 515 +++++++++++++
net/batman-adv/bat_v_elp.h | 33 +
net/batman-adv/bat_v_ogm.c | 833 +++++++++++++++++++++
net/batman-adv/bat_v_ogm.h | 36 +
net/batman-adv/distributed-arp-table.c | 4 +-
net/batman-adv/fragmentation.c | 8 +-
net/batman-adv/gateway_common.c | 4 +-
net/batman-adv/gateway_common.h | 2 +
net/batman-adv/icmp_socket.c | 2 +-
net/batman-adv/main.c | 7 +
net/batman-adv/main.h | 12 +-
net/batman-adv/network-coding.c | 22 +-
net/batman-adv/packet.h | 49 ++
net/batman-adv/send.c | 55 +-
net/batman-adv/send.h | 10 +-
net/batman-adv/sysfs.c | 130 ++++
net/batman-adv/types.h | 93 +++
24 files changed, 2190 insertions(+), 37 deletions(-)
create mode 100644 net/batman-adv/bat_v.c
create mode 100644 net/batman-adv/bat_v_elp.c
create mode 100644 net/batman-adv/bat_v_elp.h
create mode 100644 net/batman-adv/bat_v_ogm.c
create mode 100644 net/batman-adv/bat_v_ogm.h
Hi,
the oldest kernel still supported via linux-stable reached its EOL [1]. It
looks like also the distribution releases with such an old kernel are starting
to die [2]. So I would propose to first disable the checks for kernels < 3.2
from the daily build_tests [3]. Then someone would have to change the oldest
supported kernel in README.external and CHANGELOG. The last step would be to
remove the actual support from the compat files [4,5].
This would remove 13 of the ~38 supported kernels. Or to say it with years:
The oldest kernel supported will only be 4 years old and not anymore ~7 years.
Any opinions about that?
Kind regards,
Sven
[1] https://lkml.org/lkml/2016/1/29/647
[2] Debian squeeze LTS ended on 2016-02-29
https://wiki.debian.org/LTS/Using
[3] https://patchwork.open-mesh.org/patch/4588/
[4] https://patchwork.open-mesh.org/patch/4592/
[5] Yes, this should remove the really fantastic warning
"subtraction of functions? Share your drugs"
This patchset introduces optimizations for batman-adv in setups having several gateways into a common (switched) Ethernet backbone network especially if dat is additionally enabled.
Using the current implementation with bla and dat enabled, several problems can be observed in a real setup:
1. Multiplication of ARP replies from dat enabled gateways and dat enabled mesh nodes leading to an "ARP reply storm" in the common backbone network.
2. In rare corner cases bla does not fully prevent looping of unicast frames in the direction backbone --> mesh --> backbone and looping of multicast frames in the direction mesh --> backbone --> mesh.
The latter can lead to temporary confusion in the switched backbone resulting in packet loss and communication timeouts.
The observed problems are solved by introduction of additional rules for the dat handling, bla packet forwarding and bla claiming/unclaiming of clients.
..................................................................
PHOENIX CONTACT ELECTRONICS GmbH
Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Roland Bent, Dr. Martin Heubeck
___________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________
The __ethtool_get_link_ksettings is currently used only for kernels >=
3.15. But the compat code is read by the compiler for each kernel. But
kernels up to 3.1 never had the function __ethtool_get_settings which is
used to emulate this function for kernels < 4.6. Therefore, kernels < 3.2
will fail to compile when this compatibility layer is enabled.
Fixes: 3515604d82d5 ("batman-adv: ELP - use new ethtool_link_get_ksettings API")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
compat-include/linux/ethtool.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/compat-include/linux/ethtool.h b/compat-include/linux/ethtool.h
index 87f7577..a24390a 100644
--- a/compat-include/linux/ethtool.h
+++ b/compat-include/linux/ethtool.h
@@ -24,7 +24,9 @@
#include <linux/version.h>
#include_next <linux/ethtool.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
+/* WARNING only enabled on kernels with __ethtool_get_settings support */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) && \
+ LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#define ethtool_link_ksettings batadv_ethtool_link_ksettings
--
2.7.0