The following commit has been merged in the merge/master branch:
commit fb3b8a32736aa6c19c58dc84677e838d1f1ca4c3
Author: Def <def(a)laposte.net>
Date: Thu Sep 20 14:56:13 2012 +0200
batman-adv: Fix change mac address of soft iface.
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(a)laposte.net>
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 7b683e0..b9a28d2 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -107,18 +107,21 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
{
struct batadv_priv *bat_priv = netdev_priv(dev);
struct sockaddr *addr = p;
+ uint8_t old_addr[ETH_ALEN];
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
+ memcpy(old_addr, dev->dev_addr, ETH_ALEN);
+ memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+
/* only modify transtable if it has been initialized before */
if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) {
- batadv_tt_local_remove(bat_priv, dev->dev_addr,
+ batadv_tt_local_remove(bat_priv, old_addr,
"mac address changed", false);
batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX);
}
- memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
return 0;
}
--
linux integration
The following commit has been merged in the merge/master branch:
commit 7b390de223ace6aa4009a22cdac56e48bdab00af
Author: Linus Lüssing <linus.luessing(a)web.de>
Date: Tue Sep 18 03:01:08 2012 +0200
batman-adv: Fix symmetry check / route flapping in multi interface setups
If receiving an OGM from a neighbor other than the currently selected
and if it has the same TQ then we are supposed to switch if this
neighbor provides a more symmetric link than the currently selected one.
However this symmetry check currently is broken if the interface of the
neighbor we received the OGM from and the one of the currently selected
neighbor differ: We are currently trying to determine the symmetry of the
link towards the selected router via the link we received the OGM from
instead of just checking via the link towards the currently selected
router.
This leads to way more route switches than necessary and can lead to
permanent route flapping in many common multi interface setups.
This patch fixes this issue by using the right interface for this
symmetry check.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
Conflicts:
net/batman-adv/bat_iv_ogm.c
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index df79300..b02b75d 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -652,6 +652,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
struct batadv_neigh_node *router = NULL;
struct batadv_orig_node *orig_node_tmp;
struct hlist_node *node;
+ int if_num;
uint8_t sum_orig, sum_neigh;
uint8_t *neigh_addr;
uint8_t tq_avg;
@@ -738,12 +739,14 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
if (router && (neigh_node->tq_avg == router->tq_avg)) {
orig_node_tmp = router->orig_node;
spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
- sum_orig = orig_node_tmp->bcast_own_sum[if_incoming->if_num];
+ if_num = router->if_incoming->if_num;
+ sum_orig = orig_node_tmp->bcast_own_sum[if_num];
spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
orig_node_tmp = neigh_node->orig_node;
spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
- sum_neigh = orig_node_tmp->bcast_own_sum[if_incoming->if_num];
+ if_num = neigh_node->if_incoming->if_num;
+ sum_neigh = orig_node_tmp->bcast_own_sum[if_num];
spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
if (sum_orig >= sum_neigh)
--
linux integration
The annotated tag, v3.7-rc1 has been created
at b93229f2cc1b8bb260135c3da61733ed92568fd3 (tag)
tagging ddffeb8c4d0331609ef2581d84de4d763607bd37 (commit)
replaces v3.6
tagged by Linus Torvalds
on Sun Oct 14 14:41:14 2012 -0700
- Shortlog ------------------------------------------------------------
Linux 3.7-rc1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
iQEcBAABAgAGBQJQezF+AAoJEHm+PkMAQRiG2wkIAIpxXCCZo8SsxOimo0jkb50r
Ouufv/92lz7LNqPEsaQDYXNni+1ObEnADU2XbXdfJ6pdQkfw3Phu/IIzZAufIS21
ZTDgK04D1HA0inx8ywHr96bSEfHu0RCuj5jMu2/N5F5jZbvvaHpeIaCfKWXtQ2Tg
yAuFY6mp6MVXCJPnJbvb5inVpDlfAXCHQ4BLFHQL0MhfPW0eNHhgyWJQsn8UywxK
rYdIet1RAL+iY+C7gr5SIRXRg0CF8zAyBRJMIyB8kfY26YvwEy75zHf1TavxtT1X
o4B/WSqO4JbAM4yuRFFpb/ehNtfalxLX7JFexSHzBRev95yllQ6a3UTgtM1Ch8E=
=Vg7R
-----END PGP SIGNATURE-----
Antonio Quartulli (5):
batman-adv: move function arguments on one line
batman-adv: add reference counting for type batadv_tt_orig_list_entry
batman-adv: fix typos in comments
batman-adv: detect not yet announced clients
batman-adv: change interface_rx to get orig node
David S. Miller (1):
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Jonathan Corbet (1):
batman-adv: remove a misleading comment
Marek Lindner (1):
batman-adv: convert remaining packet counters to per_cpu_ptr() infrastructure
Martin Hundebøll (2):
batman-adv: Move batadv_check_unicast_packet()
batman-adv: Drop tt queries with foreign dest
Simon Wunderlich (4):
batman-adv: Add the backbone gateway list to debugfs
batman-adv: correct comments in bridge loop avoidance
batman-adv: rename bridge loop avoidance claim types
batman-adv: check batadv_orig_hash_add_if() return code
Sven Eckelmann (5):
batman-adv: Split batadv_priv in sub-structures for features
batman-adv: Use BIT(x) macro to calculate bit positions
batman-adv: Don't break statements after assignment operator
batman-adv: Reduce accumulated length of simple statements
batman-adv: Start new development cycle
-----------------------------------------------------------------------
--
linux integration
Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
>---------------------------------------------------------------
commit a6ad8574ea13f3463bae39324d093e6c31682cc8
Author: Simon Wunderlich <simon.wunderlich(a)s2003.tu-chemnitz.de>
Date: Sun Oct 14 14:46:57 2012 +0200
batman-adv: dirty hack to recompute mac_len in the rx path
It is possible that the mac_len is not properly exported because of
strange device configuration (this behaviour has been observed when
using batman-adv on top of a vlan interface). Therefore it is needed to
explicitly recompute it at the very beginning of the rx path.
This is done by appending the recompute function to the skb_share_mac()
function, hence the "dirty hack" in the subject. We expect this problem to
be fixed in linux 3.8 and above.
Reported-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
a6ad8574ea13f3463bae39324d093e6c31682cc8
compat.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/compat.h b/compat.h
index 13253dd..081bef5 100644
--- a/compat.h
+++ b/compat.h
@@ -145,6 +145,11 @@ void batadv_free_rcu_neigh_node(struct rcu_head *rcu);
void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu);
void batadv_free_rcu_backbone_gw(struct rcu_head *rcu);
+static inline void skb_reset_mac_len(struct sk_buff *skb)
+{
+ skb->mac_len = skb->network_header - skb->mac_header;
+}
+
#endif /* < KERNEL_VERSION(3, 0, 0) */
@@ -157,4 +162,23 @@ static inline void eth_hw_addr_random(struct net_device *dev)
#endif /* < KERNEL_VERSION(3, 4, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
+
+/* hack for not correctly set mac_len. This may happen for some special
+ * configurations like batman-adv on VLANs.
+ *
+ * This is pretty dirty, but we only use skb_share_check() in main.c right
+ * before mac_len is checked, and the recomputation shouldn't hurt too much.
+ */
+#define skb_share_check(skb, b) \
+ ({ \
+ struct sk_buff *_t_skb; \
+ _t_skb = skb_share_check(skb, b); \
+ if (_t_skb) \
+ skb_reset_mac_len(_t_skb); \
+ _t_skb; \
+ })
+
+#endif /* < KERNEL_VERSION(3, 8, 0) */
+
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit d7cc20fc1442893fd60d00c4f4540aecb3f5ba01
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun Oct 14 17:19:19 2012 +0200
batman-adv: enable fast client detection using unicast_4addr packets
The "early client detection mechanism" can be extended to find new clients by
means of unicast_4addr packets.
The unicast_4addr packet contains as well as the broadcast packet (which is
currently used in this mechanism) the address of the originating node and can
therefore be used to install new entries in the Global Translation Table
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
d7cc20fc1442893fd60d00c4f4540aecb3f5ba01
routing.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/routing.c b/routing.c
index 96375c5..c2c4de3 100644
--- a/routing.c
+++ b/routing.c
@@ -1042,6 +1042,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct batadv_unicast_packet *unicast_packet;
struct batadv_unicast_4addr_packet *unicast_4addr_packet;
+ uint8_t *orig_addr;
+ struct batadv_orig_node *orig_node = NULL;
int hdr_size = sizeof(*unicast_packet);
bool is4addr;
@@ -1061,9 +1063,12 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
/* packet for me */
if (batadv_is_my_mac(unicast_packet->dest)) {
- if (is4addr)
+ if (is4addr) {
batadv_dat_inc_counter(bat_priv,
unicast_4addr_packet->subtype);
+ orig_addr = unicast_4addr_packet->src;
+ orig_node = batadv_orig_hash_find(bat_priv, orig_addr);
+ }
if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb,
hdr_size))
@@ -1073,9 +1078,12 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
goto rx_success;
batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size,
- NULL);
+ orig_node);
rx_success:
+ if (orig_node)
+ batadv_orig_node_free_ref(orig_node);
+
return NET_RX_SUCCESS;
}
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit f395fb789451873cb5eab2411f41f65a7dc49913
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun Oct 14 16:54:33 2012 +0200
batctl: add DAT runtime switch support
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
f395fb789451873cb5eab2411f41f65a7dc49913
functions.c | 1 +
man/batctl.8 | 4 ++++
sys.c | 6 ++++++
sys.h | 1 +
4 files changed, 12 insertions(+)
diff --git a/functions.c b/functions.c
index 0d88137..1cde235 100644
--- a/functions.c
+++ b/functions.c
@@ -46,6 +46,7 @@ const char *fs_compile_out_param[] = {
SYS_LOG,
SYS_LOG_LEVEL,
batctl_settings[BATCTL_SETTINGS_BLA].sysfs_name,
+ batctl_settings[BATCTL_SETTINGS_DAT].sysfs_name,
batctl_debug_tables[BATCTL_TABLE_BLA_CLAIMS].debugfs_name,
batctl_debug_tables[BATCTL_TABLE_BLA_BACKBONES].debugfs_name,
batctl_debug_tables[BATCTL_TABLE_DAT].debugfs_name,
diff --git a/man/batctl.8 b/man/batctl.8
index 6ff60ef..fdc788e 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -66,6 +66,10 @@ If no parameter is given the current bridge loop avoidance setting is displayed.
or disable the bridge loop avoidance. Bridge loop avoidance support has to be enabled when compiling the module otherwise
this option won't be available.
.br
+.IP "\fBdistributed_arp_table\fP|\fBdat\fP [\fB0\fP|\fB1\fP]"
+If no parameter is given the current distributed arp table setting is displayed. Otherwise the parameter is used to
+enable or disable the distributed arp table.
+.br
.IP "\fBvis_mode|vm\fP [\fBclient|server\fP]\fP"
If no parameter is given the current vis mode is displayed otherwise the parameter is used to set the vis mode.
.br
diff --git a/sys.c b/sys.c
index 815ff88..3d5e129 100644
--- a/sys.c
+++ b/sys.c
@@ -69,6 +69,12 @@ const struct settings_data batctl_settings[BATCTL_SETTINGS_NUM] = {
.params = sysfs_param_enable,
},
{
+ .opt_long = "distributed_arp_table",
+ .opt_short = "dat",
+ .sysfs_name = "distributed_arp_table",
+ .params = sysfs_param_enable,
+ },
+ {
.opt_long = "vis_mode",
.opt_short = "vm",
.sysfs_name = "vis_mode",
diff --git a/sys.h b/sys.h
index 1fc473e..40b64b1 100644
--- a/sys.h
+++ b/sys.h
@@ -35,6 +35,7 @@ enum batctl_settings_list {
BATCTL_SETTINGS_ORIG_INTERVAL,
BATCTL_SETTINGS_AP_ISOLATION,
BATCTL_SETTINGS_BLA,
+ BATCTL_SETTINGS_DAT,
BATCTL_SETTINGS_VIS_MODE,
BATCTL_SETTINGS_AGGREGATION,
BATCTL_SETTINGS_BONDING,
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit ac2726519769ed5b7463e214e0a6f96419090c18
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun Oct 14 16:54:32 2012 +0200
batctl: add support for the DAT log level
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
ac2726519769ed5b7463e214e0a6f96419090c18
README | 1 +
man/batctl.8 | 7 ++++---
sys.c | 7 ++++++-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/README b/README
index 5e58452..22ad616 100644
--- a/README
+++ b/README
@@ -342,6 +342,7 @@ $ batctl loglevel
[ ] messages related to route added / changed / deleted (routes)
[ ] messages related to translation table operations (tt)
[ ] messages related to bridge loop avoidance (bla)
+[ ] messages related to arp snooping and distributed arp table (dat)
batctl aggregation
==================
diff --git a/man/batctl.8 b/man/batctl.8
index 7983ea2..6ff60ef 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -85,9 +85,10 @@ disable fragmentation.
If no parameter is given the current log level settings are displayed otherwise the parameter(s) is/are used to set the log
level. Level 'none' disables all verbose logging. Level 'batman' enables messages related to routing / flooding / broadcasting.
Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to
-translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'all' enables all
-messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it. Make sure to have debugging
-output enabled when compiling the module otherwise the output as well as the loglevel options won't be available.
+translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'dat' enables
+messages related to ARP snooping and the Distributed Arp Table. Level 'all' enables all messages. The messages are sent
+to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it. Make sure to have debugging output enabled when compiling
+the module otherwise the output as well as the loglevel options won't be available.
.br
.IP "\fBlog\fP|\fBl\fP [\fB\-n\fP]\fP"
batctl will read the batman-adv debug log which has to be compiled into the kernel module. If "\-n" is given batctl will not
diff --git a/sys.c b/sys.c
index 6f94483..815ff88 100644
--- a/sys.c
+++ b/sys.c
@@ -258,6 +258,7 @@ static void log_level_usage(void)
printf(" \t routes Messages related to route added / changed / deleted\n");
printf(" \t tt Messages related to translation table operations\n");
printf(" \t bla Messages related to bridge loop avoidance\n");
+ printf(" \t dat Messages related to arp snooping and distributed arp table\n");
}
int handle_loglevel(char *mesh_iface, int argc, char **argv)
@@ -288,7 +289,7 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
log_level = 0;
break;
} else if (strcmp(argv[i], "all") == 0) {
- log_level = 15;
+ log_level = 31;
break;
} else if (strcmp(argv[i], "batman") == 0)
log_level |= BIT(0);
@@ -298,6 +299,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
log_level |= BIT(2);
else if (strcmp(argv[i], "bla") == 0)
log_level |= BIT(3);
+ else if (strcmp(argv[i], "dat") == 0)
+ log_level |= BIT(4);
else {
log_level_usage();
goto out;
@@ -327,6 +330,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
"messages related to translation table operations", "tt");
printf("[%c] %s (%s)\n", (log_level & BIT(3)) ? 'x' : ' ',
"messages related to bridge loop avoidance", "bla");
+ printf("[%c] %s (%s)\n", (log_level & BIT(4)) ? 'x' : ' ',
+ "messages related to arp snooping and distributed arp table", "dat");
out:
free(path_buff);