Sven Eckelmann | 25 Mar 19:51 2015

[PATCH] alfred: Make sure only link-local EUI64 is used as source

The linux kernel automatically chooses the source address. This can make
problems when the metric prefers an address which is not the link-local EUI64
address. For example an user can add an additional address which also can be
used for link-local communication but has a higher value in the metric. This
can cause alfred to send UDP link-local packets with an address which cannot be
decoded by the receiver to get the MAC address of the device. The communication
with this device would then fail.

It is possible to define the source address when we directly bind to it. This
has the problem that this address cannot receive packets with a multicast
address as destination. The workaround is to create two sockets for one netsock
structure. One is the socket which can send all data and receives unicast
packets. The second one is receiving the multicast traffic like the
announcements from master alfred server processes.

Signed-off-by: Sven Eckelmann <sven@...>
---
 alfred.h  |   4 ++-
 netsock.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 recv.c    |   5 +--
 send.c    |   2 ++
 server.c  |   2 ++
 5 files changed, 103 insertions(+), 16 deletions(-)

diff --git a/alfred.h b/alfred.h
index 621805d..adf788c 100644
--- a/alfred.h
+++ b/alfred.h
 <at>  <at>  -102,6 +102,7  <at>  <at>  struct interface {
 	uint32_t scope_id;
(Continue reading)

Sven Eckelmann | 24 Mar 18:45 2015

[PATCHv2 1/4] batman-adv: Remove explicit compat.h include and split compat.h

The current approach for the compat layer is to include the compat.h file at
exactly the right time to provide additional functionality and to live patch
the batman-adv sources. This has the problem that the compat.h file becomes
harder to read over time. Also live patching and adding of missing
functionality partially conflict. This becomes obvious when the include order
in some files is different compared to the one the author of an compat.h entry
expected.

A different approach is to inject intermediate header files which add
additional features. This allows to reduce the size of compat.h and only leaves
the live patching part in it. The compat.h can then added automatically to each
compile run before anything else is included. compat.h has therefore the
control which headers must be included before the live patching of the
batman-adv source can begin.

Signed-off-by: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw <at> public.gmane.org>
---
v2: no change

 Makefile                               |   4 +
 compat-include/linux/atomic.h          |  29 +++
 compat-include/linux/bug.h             |  38 ++++
 compat-include/linux/compiler.h        |  40 ++++
 compat-include/linux/etherdevice.h     |  45 +++++
 compat-include/linux/export.h          |  29 +++
 compat-include/linux/if_ether.h        |  33 ++++
 compat-include/linux/if_vlan.h         |  44 +++++
 compat-include/linux/kconfig.h         |  42 +++++
 compat-include/linux/kernel.h          |  44 +++++
 compat-include/linux/list.h            |  54 ++++++
(Continue reading)

Simon Wunderlich | 24 Mar 16:31 2015
Picon

Fwd: [Battlemesh] Announcing Battlemesh V8 Maribor, Slovenia

I'm sure there are some on this list who will be interested in joining! Please 
spread the word. :)

----------  Forwarded Message  ----------

Subject: [Battlemesh] Announcing Battlemesh V8 Maribor, Slovenia
Date: Monday 23 March 2015, 17:13:18
From: Musti <musti@...>
To: Battle of the Mesh Mailing List <battlemesh@...>

==========================================================
       Announcing the Wireless Battle Mesh v8
    (3rd - 9th of August 2015, Maribor, Slovenia)
==========================================================

The next 'Wireless Battle of the Mesh' will take place from Mon 3rd
till Sun 9th of August at Dom Obrambe Pekre, Maribor, Slovenia. The
event aims to bring together people from across the globe to test the
performance of different routing protocols for ad-hoc networks, like
Babel, B.A.T.M.A.N., BMX, OLSR, and 802.11s. Of course, new protocols
(working on OpenWrt) are always welcome!

It is not required to be active within the mentioned protocols, so if
you are a mesh networking enthusiast, community networking activist, or
have an interest in mesh networks in general, you have to check this out!

Information about the event is gathered at:
http://battlemesh.org/BattleMeshV8

Location
(Continue reading)

Sven Eckelmann | 22 Mar 16:23 2015

[PATCH 1/2] batman-adv: Remove dynamically allocated hashtables

It is unnecessary to allocate an extra memory region for hashtables and the
corresponding locks. This brings the hashes used in batman-adv slightly in the
direction of the common statically sized hash table implementation. More common
hashtable functionality cannot be used batman-adv wide because the simple
hashtable and rhashtable implementations don't provide bucket based locking.

A side-effect of this change is the initialization of each array of locks for
each hashtable with a different lock_class. This allows to correct nesting of
write access to two different hashtables without triggering a lockdep warning.

This also fixes the problem of unprotected access to the pointer to the
hashtables. These were dynamically allocated/freed and the pointers were stored
in batadv_priv*. Access to these pointers were never protected by any lock and
using them could always lead to problems when the batman-adv device was removed.

Signed-off-by: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw <at> public.gmane.org>
---
v5: Rebased on top of patches:

 * batman-adv: Remove explicit compat.h include and split compat.h
 * batman-adv: Add required to includes to all files
 * batman-adv: Remove unused IFF_BRIDGE_PORT live patching hack
 * batman-adv: Automatically create nested kfree_rcu helper functions

 Makefile.kbuild         |   1 -
 bat_iv_ogm.c            |  13 ++--
 bridge_loop_avoidance.c | 131 ++++++++++++-------------------------
 distributed-arp-table.c |  49 ++++----------
 hash.c                  |  80 -----------------------
 hash.h                  | 108 +++++++++++++-----------------
(Continue reading)

Sven Eckelmann | 22 Mar 15:51 2015

[PATCH 1/4] batman-adv: Remove explicit compat.h include and split compat.h

The current approach for the compat layer is to include the compat.h file at
exactly the right time to provide additional functionality and to live patch
the batman-adv sources. This has the problem that the compat.h file becomes
harder to read over time. Also live patching and adding of missing
functionality partially conflict. This becomes obvious when the include order
in some files is different compared to the one the author of an compat.h entry
expected.

A different approach is to inject intermediate header files which add
additional features. This allows to reduce the size of compat.h and only leaves
the live patching part in it. The compat.h can then added automatically to each
compile run before anything else is included. compat.h has therefore the
control which headers must be included before the live patching of the
batman-adv source can begin.

Signed-off-by: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw <at> public.gmane.org>
---
 Makefile                               |   4 +
 compat-include/linux/atomic.h          |  29 +++
 compat-include/linux/bug.h             |  38 ++++
 compat-include/linux/compiler.h        |  40 ++++
 compat-include/linux/etherdevice.h     |  45 +++++
 compat-include/linux/export.h          |  29 +++
 compat-include/linux/if_ether.h        |  33 ++++
 compat-include/linux/if_vlan.h         |  44 +++++
 compat-include/linux/kconfig.h         |  42 ++++
 compat-include/linux/kernel.h          |  44 +++++
 compat-include/linux/list.h            |  54 ++++++
 compat-include/linux/moduleparam.h     |  72 +++++++
 compat-include/linux/net.h             |  39 ++++
(Continue reading)

Andreas Pape | 19 Mar 17:54 2015

Antwort: Re: [PATCH] batman-adv: bugfix for kernel crash in batadv_tt_local_table_free

Hi Antonio,

I saw the crash, but only in the case when I add the non-IP traffic using 
VLAN ID 0. No interface of the mesh node is part of that VLAN, i.e. I 
don't use further virtual VLAN interfaces on my mesh node. This VLAN 
traffic shall only be transparently forwarded over the mesh which - by the 
way - works flawlessly. 

As soon as I remove the WLAN interface from bat0 (batctl if del ath0) I 
get the following crash report:

/ # Unable to handle kernel paging request for data at address 0x00000020
Faulting instruction address: 0xc99c35a4
Oops: Kernel access of bad area, sig: 11 [#1]
MPC831x RDB
Modules linked in: batman_adv crc32c umac ath_dev(P) ath_rate_atheros(P) 
ath_dfs(P) ath_hal(P) asf(P) adf t23xsec2 t23xrm spi_mpc8xxx ipv6
NIP: c99c35a4 LR: c99c8ca4 CTR: c00253ac
REGS: c654ddd0 TRAP: 0300   Tainted: P            (2.6.32.26-svn1313)
MSR: 00009032 <EE,ME,IR,DR>  CR: 84002082  XER: 20000000
DAR: 00000020, DSISR: 20000000
TASK = c68680e0[1105] 'bat_events' THREAD: c654c000
GPR00: 00000020 c654de80 c68680e0 00000000 00008000 c0355078 c797f3e5 
00000080
GPR08: 00000001 00000000 00000001 00000000 44002088 100d5bc0 07ffa000 
00000000
GPR16: fa3fdfef 00000000 00000000 00000000 00000000 00000000 00020000 
07e958b0
GPR24: 00000000 00000174 c7b14320 c6d382c0 00000000 00000000 00200200 
00000000
(Continue reading)

Andreas Pape | 19 Mar 16:46 2015

[PATCH] batman-adv: bugfix for kernel crash in batadv_tt_local_table_free

This missing check lead to a kernel crash when a hard_if is removed on a 
node forwarding
untagged and tagged traffic (VLANID 0) to and from the mesh network.

Signed-off-by: Andreas Pape <apape@...>
---
 translation-table.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index b20812b..4d3ab8d 100644
--- a/translation-table.c
+++ b/translation-table.c
 <at>  <at>  -1143,8 +1143,10  <at>  <at>  static void batadv_tt_local_table_free(struct 
batadv_priv *bat_priv)
                        /* decrease the reference held for this vlan */
                        vlan = batadv_softif_vlan_get(bat_priv,
 tt_common_entry->vid);
-                       batadv_softif_vlan_free_ref(vlan);
-                       batadv_softif_vlan_free_ref(vlan);
+                       if (vlan) {
+                               batadv_softif_vlan_free_ref(vlan);
+                               batadv_softif_vlan_free_ref(vlan);
+                       }

                        batadv_tt_local_entry_free_ref(tt_local);
                }
--

-- 
1.7.0.4

(Continue reading)

Andreas Pape | 19 Mar 08:05 2015

[PATCH] dat optimization test

From e0b37ee6d7d82648768dc98a95c3a61d7edf86dd Mon Sep 17 00:00:00 2001
From: Andreas Pape <apape@...>
Date: Wed, 18 Mar 2015 11:03:22 +0100
Subject: [PATCH] dat optimization test

Signed-off-by: Andreas Pape <apape@...>
---
 bridge_loop_avoidance.c |   60 +++++++++++++++++++++++++++++++++
 bridge_loop_avoidance.h |    6 +++
 distributed-arp-table.c |   85 
++++++++++++++++++++++++++++++++++++++++++++++-
 distributed-arp-table.h |    7 +++-
 routing.c               |    6 ++-
 soft-interface.c        |   17 ++++++++-
 6 files changed, 175 insertions(+), 6 deletions(-)

diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index 6927589..bdc8ac9 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
 <at>  <at>  -1712,3 +1712,63  <at>  <at>  out:
                batadv_hardif_free_ref(primary_if);
        return 0;
 }
+
+/**
+ * batadv_check_local_claim
+ *  <at> bat_priv: the bat priv with all the soft interface information
+ *  <at> addr: mac address of which the claim status is checked
+ *  <at> vid: the VLAN ID
(Continue reading)

Anatoliy Lapitskiy | 17 Mar 09:11 2015
Picon

[PATCH v5] alfred: Add "--update-command" parameter

The "--update-command" parameter is created for adding a hook to run when
new information is received.

At the moment "alfred-facters" are run by cron once per every 5 minutes.
For some tasks (like sharing dhcp leases) it can be too slow.

Signed-off-by: Anatoliy Lapitskiy <anatoliy.lapitskiy@...>
---
 alfred.h     | 11 +++++++++
 main.c       | 12 +++++++++-
 man/alfred.8 |  4 ++++
 recv.c       | 10 ++++++++
 server.c     | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 110 insertions(+), 1 deletion(-)

diff --git a/alfred.h b/alfred.h
index f26c80c..621805d 100644
--- a/alfred.h
+++ b/alfred.h
 <at>  <at>  -55,6 +55,11  <at>  <at>  struct dataset {
 	uint8_t local_data;
 };

+struct changed_data_type {
+	uint8_t data_type;
+	struct list_head list;
+};
+
 struct transaction_packet {
 	struct alfred_push_data_v0 *push;
(Continue reading)

Sven Eckelmann | 17 Mar 08:50 2015

[PATCH] batctl: Remove manual \0 terminator after snprintf

snprintf already guarantees \0 terminated strings for size arguments is > 0.

Reported-by: Anatoliy Lapitskiy <anatoliy.lapitskiy@...>
Signed-off-by: Sven Eckelmann <sven@...>
---
 bisect_iv.c |  4 ----
 debugfs.c   |  1 -
 sys.c       | 14 +-------------
 3 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/bisect_iv.c b/bisect_iv.c
index b748813..fea6358 100644
--- a/bisect_iv.c
+++ b/bisect_iv.c
 <at>  <at>  -644,7 +644,6  <at>  <at>  static int print_rt_path_at_seqno(struct bat_node *src_node, struct bat_node *ds

 	snprintf(curr_loop_magic, sizeof(curr_loop_magic), "%s%s%lli%lli", src_node->name,
 	         dst_node->name, seqno, seqno_rand);
-	curr_loop_magic[sizeof(curr_loop_magic) - 1] = '\0';

 	printf("Path towards %s (seqno %lli ",
 	       get_name_by_macstr(dst_node->name, read_opt), seqno);
 <at>  <at>  -725,7 +724,6  <at>  <at>  static int find_rt_table_change(struct bat_node *src_node, struct bat_node *dst_
 	snprintf(curr_loop_magic, sizeof(curr_loop_magic), "%s%s%lli%lli",
 	         src_node->name, dst_node->name,
 	         seqno_min_tmp, seqno_rand);
-	curr_loop_magic[sizeof(curr_loop_magic) - 1] = '\0';

 	orig_event = orig_event_get_by_ptr(curr_node, dst_node);
 	if (!orig_event)
(Continue reading)

Sven Eckelmann | 17 Mar 08:47 2015

[PATCH] alfred: Remove manual \0 terminator after snprintf

snprintf already guarantees \0 terminated strings for size arguments is > 0.

Reported-by: Anatoliy Lapitskiy <anatoliy.lapitskiy@...>
Signed-off-by: Sven Eckelmann <sven@...>
---
 debugfs.c | 1 -
 vis/vis.c | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/debugfs.c b/debugfs.c
index fbf992e..6404b49 100644
--- a/debugfs.c
+++ b/debugfs.c
 <at>  <at>  -58,7 +58,6  <at>  <at>  int debugfs_make_path(const char *fmt, const char *mesh_iface, char *buffer,
 		return len+1;

 	snprintf(buffer, size-1, fmt, debugfs_mountpoint, mesh_iface);
-	buffer[size - 1] = '\0';
 	return 0;
 }

diff --git a/vis/vis.c b/vis/vis.c
index 4a14e66..c1f8dad 100644
--- a/vis/vis.c
+++ b/vis/vis.c
 <at>  <at>  -274,7 +274,6  <at>  <at>  static int register_interfaces(struct globals *globals)

 	while ((iface_dir = readdir(iface_base_dir)) != NULL) {
 		snprintf(path_buff, PATH_BUFF_LEN, SYS_MESH_IFACE_FMT, iface_dir->d_name);
-		path_buff[PATH_BUFF_LEN - 1] = '\0';
(Continue reading)


Gmane