Hi David,
here you have a pull request intended for net-next.
There are 17 patches in this batch, but most of them are cleanups
and minor code re-arrangement.
The more detailed description follows in the git tag.
Please pull or let me know of any problem.
Thanks a lot,
Antonio
The following changes since commit c047c3b1af6214b447e353527e394fa3f3e86397:
netfilter: conntrack: remove uninitialized shadow variable (2016-05-10 01:04:04 -0400)
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 676970e55b1033af7f0a03d4037b4d9b76327ded:
batman-adv: use batadv_compare_eth when possible (2016-05-10 18:28:54 +0800)
----------------------------------------------------------------
Included changes:
- remove useless skb size check in batadv_interface_rx
- basic netns support introduced by Andrew Lunn:
- prevent virtual interface from changing netns by setting
NETIF_F_NETNS_LOCAL
- create virtual interface within the netns of the first
hard-interface
- introduce detection of complex bridge loops and report event
to the user (via udev) when the Bridge Loop Avoidance mechanism
can't prevent them
- minor reference counting bugfixes for the hard_iface object that
couldn't make it via the net tree
- use kref_get() instead of kref_get_unless_zero() to make reference
counting bug more visible
- use batadv_compare_eth() all over the code when possible instead of
plain memcmp()
- minor code cleanup and style adjustments
----------------------------------------------------------------
Andrew Lunn (2):
batman-adv: NETIF_F_NETNS_LOCAL feature to prevent netns moves
batman-adv: Create batman soft interfaces within correct netns.
Antonio Quartulli (1):
batman-adv: use batadv_compare_eth when possible
Marek Lindner (1):
batman-adv: replace ethertype variable with ETH_P_BATMAN for readability
Simon Wunderlich (1):
batman-adv: add detection for complex bridge loops
Sven Eckelmann (12):
batman-adv: Remove unused parameter recv_if of batadv_interface_rx
batman-adv: Remove hdr_size skb size check in batadv_interface_rx
batman-adv: Check hard_iface refcnt before calling function
batman-adv: Check hard_iface refcnt when receiving skb
batman-adv: Increase hard_iface refcnt for ptype
batman-adv: Use kref_get for batadv_tvlv_container_get
batman-adv: Use kref_get for batadv_nc_get_nc_node
batman-adv: Use kref_get for batadv_gw_select
batman-adv: Use kref_get for batadv_gw_node_add
batman-adv: Use kref_get for hard_iface subfunctions
batman-adv: Use kref_get for _batadv_update_route
batman-adv: Use bool as return type for boolean functions
net/batman-adv/bat_iv_ogm.c | 48 ++---
net/batman-adv/bat_v_ogm.c | 14 +-
net/batman-adv/bitarray.c | 16 +-
net/batman-adv/bitarray.h | 15 +-
net/batman-adv/bridge_loop_avoidance.c | 314 ++++++++++++++++++++++++---------
net/batman-adv/bridge_loop_avoidance.h | 43 ++---
net/batman-adv/debugfs.c | 2 +-
net/batman-adv/distributed-arp-table.c | 6 +-
net/batman-adv/gateway_client.c | 12 +-
net/batman-adv/hard-interface.c | 34 ++--
net/batman-adv/hard-interface.h | 3 +-
net/batman-adv/hash.h | 6 +-
net/batman-adv/main.c | 18 +-
net/batman-adv/main.h | 6 +-
net/batman-adv/network-coding.c | 25 +--
net/batman-adv/originator.c | 39 ++--
net/batman-adv/originator.h | 2 +-
net/batman-adv/packet.h | 1 +
net/batman-adv/routing.c | 50 +++---
net/batman-adv/routing.h | 6 +-
net/batman-adv/send.c | 6 +
net/batman-adv/soft-interface.c | 32 ++--
net/batman-adv/soft-interface.h | 10 +-
net/batman-adv/sysfs.c | 9 +-
net/batman-adv/translation-table.c | 35 ++--
net/batman-adv/types.h | 8 +
26 files changed, 465 insertions(+), 295 deletions(-)
Also update obsolete email address.
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
---
v2:
* update email address
Documentation/ABI/testing/sysfs-class-net-batman-adv | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/testing/sysfs-class-net-batman-adv
index 518f6a1..77d3083 100644
--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv
+++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv
@@ -1,13 +1,4 @@
-What: /sys/class/net/<iface>/batman-adv/throughput_override
-Date: Feb 2014
-Contact: Antonio Quartulli <antonio(a)meshcoding.com>
-description:
- Defines the throughput value to be used by B.A.T.M.A.N. V
- when estimating the link throughput using this interface.
- If the value is set to 0 then batman-adv will try to
- estimate the throughput by itself.
-
What: /sys/class/net/<iface>/batman-adv/elp_interval
Date: Feb 2014
Contact: Linus Lüssing <linus.luessing(a)web.de>
@@ -28,3 +19,12 @@ Description:
The /sys/class/net/<iface>/batman-adv/mesh_iface file
displays the batman mesh interface this <iface>
currently is associated with.
+
+What: /sys/class/net/<iface>/batman-adv/throughput_override
+Date: Feb 2014
+Contact: Antonio Quartulli <a(a)unstable.cc>
+description:
+ Defines the throughput value to be used by B.A.T.M.A.N. V
+ when estimating the link throughput using this interface.
+ If the value is set to 0 then batman-adv will try to
+ estimate the throughput by itself.
--
2.8.0.rc3
This patchset completes netns support, by disabling debugfs entries
when not in the default name space, and correctly handling interface
stack loops when the parent is in a different name space.
It additionally adds netlink support for most of the information found
in debugfs, and is netns awaire.
Note: BLA is still untested, so best assume it is broken...
v4:
* Fix the batctl o -i <ifname> use case by actually performing the
filtering on the outgoing interface
v3:
* Fix the compat with older kernels. It now at least compiles with
3.18.32. I've not booted it though.
* Add missing kerneldoc
v2:
All changes requested by Sven:
* Added lots of missing includes and structure forward declarations
* Add two kernel doc comments
* Fixed an obvious bug in BLA, but it is probably still broken...
* Merged in the compat code Sven suggested. Only compile tested with 4.5.0
Andrew Lunn (7):
batman-adv: Handle parent interfaces in a different netns
batman-adv: compat.h: Add workaround for get_link_net()
batman-adv: Suppress debugfs entries for netns's
batman-adv: compat: Workarounds for previous patch
batman-adv: Indicate netlink socket can be used with netns.
batman-adv: add B.A.T.M.A.N. Dump gateways via netlink
batman-adv: add B.A.T.M.A.N. Dump BLA claims via netlink
Matthias Schiffer (5):
batman-adv: add generic netlink query API to replace debugfs files
batman-adv: netlink: add translation table query
batman-adv: netlink: add originator and neighbor table queries
batman-adv: add B.A.T.M.A.N. IV bat_{orig, neigh}_dump implementations
batman-adv: add B.A.T.M.A.N. V bat_{orig, neigh}_dump implementations
Makefile | 1 +
compat-include/linux/netlink.h | 45 +++++
compat-include/net/genetlink.h | 34 ++++
compat.h | 13 ++
include/uapi/linux/batman_adv.h | 111 ++++++++++++
net/batman-adv/Makefile | 1 +
net/batman-adv/bat_iv_ogm.c | 277 +++++++++++++++++++++++++++++
net/batman-adv/bat_v.c | 262 ++++++++++++++++++++++++++++
net/batman-adv/bridge_loop_avoidance.c | 166 ++++++++++++++++++
net/batman-adv/bridge_loop_avoidance.h | 10 +-
net/batman-adv/debugfs.c | 18 ++
net/batman-adv/gateway_client.c | 131 ++++++++++++++
net/batman-adv/gateway_client.h | 2 +
net/batman-adv/hard-interface.c | 50 +++++-
net/batman-adv/main.c | 51 ++++++
net/batman-adv/main.h | 2 +
net/batman-adv/netlink.c | 302 ++++++++++++++++++++++++++++++++
net/batman-adv/netlink.h | 41 +++++
net/batman-adv/originator.c | 161 +++++++++++++++++
net/batman-adv/originator.h | 4 +
net/batman-adv/packet.h | 36 ----
net/batman-adv/translation-table.c | 308 +++++++++++++++++++++++++++++++++
net/batman-adv/translation-table.h | 4 +
net/batman-adv/types.h | 9 +
24 files changed, 1995 insertions(+), 44 deletions(-)
create mode 100644 compat-include/linux/netlink.h
create mode 100644 compat-include/net/genetlink.h
create mode 100644 include/uapi/linux/batman_adv.h
create mode 100644 net/batman-adv/netlink.c
create mode 100644 net/batman-adv/netlink.h
--
2.8.0.rc3
This patchset enables the usage of the batman-adv multicast optimizations
for scenarios involving bridges on top of e.g. bat0, too.
The first one alters the forwarding behaviour for IGMP and MLD reports
which is a prerequisite before enabling multicast optimizations in
bridged setups. It also increases the MCAST TVLV version number to 2.
More on the issue of insufficient report handling with the v1
MCAST TVLV can be found here:
http://www.open-mesh.org/projects/batman-adv/wiki/Multicast-optimizations-l…
The second patch finally enables the multicast optimizations for
bridged setups.
Along come two more patches adding according debugging facilities
to make it possible for the user to check why the multicast
optimizations might not work ideally to give hints about
what they might change about their topology.
This patchset can be found in the current linus/multicast-bridge
branch.
Cheers, Linus
-----
Changes in v14:
* replaced compat-sources/net/bridge/br_multicast.c with
"static inline [foo]" and #defines in
compat-include/linux/if_bridge.h
Changes in v13:
* Substituted a non-breaking space with a boring one
* Dropped compat code for kernels < 3.2
* Removed mcast tvlv container and handler support for v1 completely
* Rebase to current master branch
(automatic 3-way merge without issues)
Changes in v12:
* Rebase to current master branch
(automatic 3-way merge, then batadv_hardif_free_ref() -> batadv_hardif_put())
* Adding Linux upstream fix to compat-sources/net/core/skbuff.c
-> "net: fix bridge multicast packet checksum validation"
(9b368814b33, present since v4.5, queued for stable)
Changes in v11:
* Rewording of commit messages (PATCH 1/4+2/4)
* Rebasing to master (solving conflict with kernel doc "return" changes)
* Updating kerneldoc to proper "Return:" syntax
* Using eth_zero_addr() over memset (fixes a new checkpatch warning)
* Changing uint8_t to u8 and uint32_t to u32 (fixes new checkpatch warnings)
* Turning some batadv_dbg() into batadv_info(), making querier presence more
visible (i.e. in dmesg too) (PATCH 3/4)
Changes in v10:
- PATCH 1/4:
* Former "[PATCH 4/4] batman-adv: Forward IGMP/MLD reports to selected querier (only)"
substituted by the interim branch "batman-adv: Always flood IGMP/MLD reports"
with the following changes:
* Increased compatibility to mcast-v1-tvlv nodes by
registering a v1 tvlv container and handler, too
(note: PATCH 2/4 needs to still unregister the handler
if the node is bridged bc. it can't "trust" v1 nodes)
* Removed skb_set_network_header() call
(extra patch pending for review for maint)
* Compared to patchset v9 this substitution makes things
compilable again for kernels < 2.6.35
- PATCH 2/4:
* Moved enum introduction of BATADV_DBG_MCAST to PATCH 3/4,
not needed in PATCH 2/4 yet
* Adjusted compat code to new compat layout
* Adjustments to batadv_mcast_mla_tvlv_update() to fit now
preceding PATCH 1/4
* bat_priv->mcast.bridged flag already introduced here
(instead of in PATCH 3/4) because we need it for the new
mcast-v1-tvlv handling
---
Interim Changlog of
"batman-adv: Always flood IGMP/MLD reports"
v1:
* Removed query snooping and state
* Squashed all three patches into one
* Renamed "batadv_mcast_tvlv_ogm_handler_v1()" to *_v2()
* Added explicit icmpv6.h include
* Rebased on top of master
-----
Interim Interim Changelog of
"batman-adv: Unicasting multicast reports to querier-node only"
v6:
* compat: copied copyright headers from original upstream c files
* compat: unified ordering in compat c files:
-> copyright header, then includes, then kernel specific functions
v5:
* Removed RFC tag: Needed exports got merged to net-next and are going to
be available with Linux 4.2
* Redid compat solution - now fully backwards compatible down to 2.6.33
v4:
* excluded bridge part from this patchset, they should
hopefully be added to net-next soon
* Added a compat solution (PATCH 3/3)
* Removed Kconfig-depends as by David's suggestion the needed parsing
functions for MLD are going to be forced built-ins even if IPv6 is
going to be built as a module
* Removed unused variable 'int ret' in batadv_mcast_is_report_ipv6()
* Adjusted to new folder structure
v3:
* Adding Kconfig-depends and #if's
(so basically adding similar dependancy constraints as the bridge code
has, except that there are no depends if batman-adv gets compiled without
multicast optimizations)
-> the case of IPv6=M and batman-adv=y is still impossible if multicast
optimizations are enabled; but I don't see the practical demand for that
either - people who use IPv6 as a module will probably also want to
use batman-adv as a module
v2:
* various bugfixes (now runtime tested, too - should(tm) work)
* added netdev+bridge mailinglists
-----
---
Changes in v9:
- PATCH 1/4:
* fix: added compat code for pr_warn_once()
* compat fix for bridge export stubs: fixes compile error
with kernels < 3.16 without bridge (snooping) support
- PATCH 2/4:
* perform updates of variables within bat_priv->mcast.querier_ipv{4,6}
individually (there's a new, third member in 4/4 which shouldn't be
overriden)
* PATCH 4/4: NEW
Changes in v8 (thanks to Simon's suggestions):
- PATCH 2/3:
* print shadowing status log of an appearing and shadowing querier, too
(the bridge-querier-existence call has an additional 10s delay
to ensure reports had their time to arrive -
the bridge-querier-port call doesn't have that)
- PATCH 3/3:
* changing debugfs output from "+" and "-" to "U/4/6" and "."
* fixing "no querier present" logic (introduced in [PATCHv7 3/3])
Changes in v7 (thanks to Simon's suggestions):
- PATCH 2/3:
* renaming old/new_querier to old/new_state
* slightly extended kerneldoc of batadv_mcast_querier_log()
* removing words "good" and "bad" from debug output
* simplified batadv_mcast_flags_log()
* assignment instead of memset in batadv_mcast_mla_tvlv_update()
and batadv_softif_init_late()
* simple struct member assignments instead of one complex struct
assigment
* removing unnecessary memcmp's
* substituting return statement for an if-block in
batadv_mcast_querier_log() and batadv_mcast_bridge_log()
* print "Unsnoopables(U)-flag" instead of just "U-flag"
- PATCH 3/3:
* use bat_priv values instead of querying bridge ABI in
batadv_mcast_flags_print_header()
Changes in v6:
* New PATCH 2/3 inserted, moving logging to separate patch
* More verbose logging added to PATCH 2/3:
Bridge and querier state changes are logged too
* upper case to lower case for kernel doc of batadv_mcast_flags_open
(PATCH 2/3)
* Adding note to kernel doc of batadv_mcast_get_bridge about
increased refcount (PATCH 1/3)
* Printing some lines about current bridge and querier state to
debugfs too (PATCH 3/3)
Changes in v5 (PATCH 2/2 only):
* s/dat_cache/mcast_flags/ in kerneldoc (copy&paste error)
Changes in v4 (PATCH 2/2 only):
* initial {ad,e}dition of this patch
Changes in v3 (PATCH 1/2 only):
* Removed "RFC" tag in title again: The stubs and new export are upstream
in net-next and therefore going to be included in 3.17
* Added some debug output:
* Two warning messages:
-> Old kernel version or no bridge IGMP/MLD snooping compiled
* New batman-adv log-level "mcast":
-> Logging mcast flag changes
(a third debugging facility, a new table for debugfs for a global
mcast flag overview will be added in a separate patch later
as discussed with Simon)
Changes in v2 (PATCH 1/2 only):
* fetching local (= on this same kernel) multicast listeners from
the bridge instead of the bat0 interface if a bridge is present
- just like ip addresses and routes should be used from br0, the
same goes for multicast listeners
* beautification of batadv_mcast_mla_br_addr_cpy(), now using already
present functions from the kernel instead of own, hackish approach
* changed names of some goto-labels (not using "skip" anymore)
* using new, third bridge multicast export (because this export is
not upstream yet, I've added the "RFC" in the title):
br_multicast_has_querier_anywhere()
* adding compat stubs for two bridge multicast exports, to make
batman-adv compile- and usable even if a 3.16 kernel was compiled
without bridge code - the stubs are supposed to be upstream in the
bridge code in 3.17 (therefore just 'compat')
* updated kerneldocs for batadv_mcast_mla_bridge_get() and
batadv_mcast_mla_softif_get()
* The two sentences in the commit message starting with "Queriers: ..."
were slightly modified to include the third bridge multicast export
The ELP interval and throughput override interface settings are initialized
with default settings on every iface_enable() call. Thus, the user space
configuration is overridden as soon as an interface is going down and
coming up again.
This patch prevents this behavior by moving the configuration init to the
interface detection routine which runs only once per interface.
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
---
net/batman-adv/bat_v.c | 5 -----
net/batman-adv/bat_v_elp.c | 1 -
net/batman-adv/hard-interface.c | 7 +++++++
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index c16cd44..3c5d251 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -70,11 +70,6 @@ static int batadv_v_iface_enable(struct batadv_hard_iface *hard_iface)
if (ret < 0)
batadv_v_elp_iface_disable(hard_iface);
- /* enable link throughput auto-detection by setting the throughput
- * override to zero
- */
- atomic_set(&hard_iface->bat_v.throughput_override, 0);
-
return ret;
}
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 8909d1e..cf0262b 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -344,7 +344,6 @@ int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface)
/* randomize initial seqno to avoid collision */
get_random_bytes(&random_seqno, sizeof(random_seqno));
atomic_set(&hard_iface->bat_v.elp_seqno, random_seqno);
- atomic_set(&hard_iface->bat_v.elp_interval, 500);
/* assume full-duplex by default */
hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX;
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index db2009d..dd6a5a2 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -683,6 +683,13 @@ batadv_hardif_add_interface(struct net_device *net_dev)
if (batadv_is_wifi_netdev(net_dev))
hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
+ /* enable link throughput auto-detection by setting the throughput
+ * override to zero
+ */
+ atomic_set(&hard_iface->bat_v.throughput_override, 0);
+
+ atomic_set(&hard_iface->bat_v.elp_interval, 500);
+
/* extra reference for return */
kref_init(&hard_iface->refcount);
kref_get(&hard_iface->refcount);
--
2.8.0.rc3
Hi,
I got no no other suggestion for the problems in my last RFC mails. So
I've just implemented the workaround with an extra socket. The idea is
* userspace opens "batman-adv" "tpmeter" multicast netlink socket to
listen for tpmeter events
* tp_meter is started by userspace
- kernel returns a u32 cookie for the session
* userspace is listening for events on the multicast netlink socket
* tp_meter either finishes or is cancelled
- kernel sends tp_meter message containing the result over the
multicast group for batman-adv tpmeter
* userspace receives the events and matches against its own cookie
* result is printed
This approach seems to work ok enough in my tests (only VMs [1]). But
the last patches are still marked as RFC because the use of multicast
groups introduces a backward compatibility problem. The 3.12 (and lower)
implementation for registering and starting multicast netlink messages
was completely different. backports.git has its own solution (which is
rather hard to read and I didn't start to figure out how to create a
small version for batman-adv) and someone could maybe port their
solution to the batman-adv compat code.
So if someone else wants to have a look at the compat code - please feel
free play around with it.
Kind regards,
Sven
[1] https://www.open-mesh.org/projects/open-mesh/wiki/Emulation_Debug
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
---
Documentation/ABI/testing/sysfs-class-net-batman-adv | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/testing/sysfs-class-net-batman-adv
index 518f6a1..ef630a6 100644
--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv
+++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv
@@ -1,13 +1,4 @@
-What: /sys/class/net/<iface>/batman-adv/throughput_override
-Date: Feb 2014
-Contact: Antonio Quartulli <antonio(a)meshcoding.com>
-description:
- Defines the throughput value to be used by B.A.T.M.A.N. V
- when estimating the link throughput using this interface.
- If the value is set to 0 then batman-adv will try to
- estimate the throughput by itself.
-
What: /sys/class/net/<iface>/batman-adv/elp_interval
Date: Feb 2014
Contact: Linus Lüssing <linus.luessing(a)web.de>
@@ -28,3 +19,12 @@ Description:
The /sys/class/net/<iface>/batman-adv/mesh_iface file
displays the batman mesh interface this <iface>
currently is associated with.
+
+What: /sys/class/net/<iface>/batman-adv/throughput_override
+Date: Feb 2014
+Contact: Antonio Quartulli <antonio(a)meshcoding.com>
+description:
+ Defines the throughput value to be used by B.A.T.M.A.N. V
+ when estimating the link throughput using this interface.
+ If the value is set to 0 then batman-adv will try to
+ estimate the throughput by itself.
--
2.8.0.rc3
I am trying to get familiar with the Alfred tools and downloaded version
2016.1. Unfortunately it didn't work - I couldn't get past a bind error:
root@sierra1:~# ./alfred -m -i bat0
can't bind: Cannot assign requested address
Failed to open interfaces
I had setup batman-adv with the commands:
batctl if add eth0
ip link set up bat0 (eth0 was already up)
I rolled back to 2015.0 (per a hint at
http://wiki.pinneberg.freifunk.net/alfred) and alfred started up just
fine instead of giving the error. However it periodically gives the
following message:
announce master ...
Error during sent: Cannot assign requested address
I also tried alfred -m -i eth0 with the same results.
Is there something wrong in my configuration? Can anyone point me in
the right direction? I've read through the Wiki for both batman-adv and
alfred and am out of ideas.
I'm trying to prove this setup and get familiar with it in a virtual
environment, so I am using VirtualBox to setup a network of 4 nodes in
my mesh. Should be simple enough, and batman-adv seems to work just
great - once its up and running, all nodes can communicate one with
another as expected. Only issue is I am trying to get alfred to work
with batadv-vis to give me a graph to tell me it really is working right.
Thoughts?
Thanks!
Jon
--
Jonathan R. Haws
Embedded Engineer
Space Dynamics Laboratory
jhaws(a)sdl.usu.edu