Commit Graph

182 Commits

Author SHA1 Message Date
Adrian Schmutzler 4b457916ea batman-adv: improve version string
This changes the package version string so it does not start
with "openwrt", but with the base version we are modifying:

So far: openwrt-2019.4-1
Now:    2019.4-openwrt-1

Since it's us modifying version 2019.4 (in this case), this order
is more convenient (and also closer to what the kernel version
string does).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-11-11 12:39:26 +01:00
Sven Eckelmann 87d0884fa5 batman-adv: upgrade package to latest release 2019.4
* support latest kernels (3.16 - 5.4)
* coding style cleanups and refactoring
* implement aggregation of OGM2 packets
* bugs squashed:

  - fix length validation in netlink messages
  - fix out of buffer read when parsing aggregated packets
  - avoid race condition in OGM(2) packet modification and submission

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-10-25 23:34:34 +02:00
Sven Eckelmann 366c9e0078 batman-adv: Extend PKG_LICENSE* information
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-10-25 23:34:34 +02:00
Sven Eckelmann ce3569e159 batman-adv: upgrade package to latest release 2019.3
* support latest kernels (3.16 - 5.3)
* coding style cleanups and refactoring
* add routable multicast optimizations
* bugs squashed:

  - fix duplicated OGMs on NETDEV_UP
  - fix dumping of multicast flags

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-01 17:53:51 +02:00
Sven Eckelmann 34b730e6ab batman-adv: Switch proto scripts to new prefixes
The '-m' option to select the mesh interface or vlan interfaces was
replaced with device type specific subcommand prefixes:

* meshif <netdev>
* vlan <vdev>
* meshif <netdev> vid <vid>
* hardif <netdev>

This change should also be made in the proto script to allow batctl to drop
the support of '-m' completely in the future.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-01 17:45:46 +02:00
Sven Eckelmann 89bcb4b22f batman-adv: Drop compat-hacks for unsupported kernel versions
OpenWrt only supports kernel 4.9, 4.14 and 4.19. Older kernel versions than
4.9 therefore don't require support.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-01 17:30:10 +02:00
Sven Eckelmann 9e7dbf9ba9 batman-adv: Use Linux 5.2 API again
The mac80211 package version was updated to a 5.2 based one in commit
0b2c42ced21a ("mac80211: Update to version 5.2-rc7"). The batman-adv module
must therefore no longer the pre-5.2 API.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-07-22 10:02:46 +02:00
Sven Eckelmann e87a25f408 batman-adv: Don't try to set unconfigured ap_isolation for vlan
The ap_isolation setting only supports boolean values. So setting an empty
string as ap_isolation is not supported by batctl.

Fixes: f5205d7d24 ("batman-adv: upgrade package to latest release 2014.2.0")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-06-16 09:29:42 +02:00
Sven Eckelmann 67875e2069 batman-adv: Add support for hardif settings
B.A.T.M.A.N. V support additional settings which are hardif specific. The
batadv_hardif proto has to expose them to allow automatic configuration.
The default configuration would be:

  config interface 'bat0_hardif_eth0'
  	option proto 'batadv_hardif'
  	option master 'bat0'
  	option ifname 'eth0'
  	option mtu '1536'
  	option 'elp_interval' 500
  	# string like '1mbit' is accepted instead of kbit for override
  	option 'throughput_override' '0'

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-06-15 09:53:55 +02:00
Sven Eckelmann e26096ae1d batman-adv: Fix duplicated OGMs on NETDEV_UP
The state of slave interfaces are handled differently depending on whether
the interface is up or not. All active interfaces (IFF_UP) will transmit
OGMs. But for B.A.T.M.A.N. IV, also non-active interfaces are scheduling
(low TTL) OGMs on active interfaces. The code which setups and schedules
the OGMs must therefore already be called when the interfaces gets added as
slave interface and the transmit function must then check whether it has to
send out the OGM or not on the specific slave interface.

But v2016.3 moved the setup code from the enable function to the activate
function. The latter is called either when the added slave was already up
when batadv_hardif_enable_interface processed the new interface or when a
NETDEV_UP event was received for this slave interfac. As result, each
NETDEV_UP would schedule a new OGM worker for the interface and thus OGMs
would be send a lot more than expected.

Fixes: 549909f89d ("batman-adv: upgrade package to latest release 2016.3")
Reported-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-06-02 14:08:16 +02:00
Sven Eckelmann 1ff00eebae batman-adv: upgrade package to latest release 2019.2
* support latest kernels (3.16 - 5.2)
* coding style cleanups and refactoring
* implement multicast-to-unicast support for multiple targets
* deprecate sysfs support and make it optional
* refresh DAT entry timeouts on incoming ARP Replies
* bugs squashed:

  - fix multicast tt/tvlv worker locking
  - drop roam tvlv handler when unregistering mesh interface

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-05-23 20:21:54 +02:00
Sven Eckelmann 312fd8afc1 batman-adv: upgrade package to latest release 2019.1
* support latest kernels (3.16 - 5.1)
* coding style cleanups and refactoring
* implement meshif, hardif and vlan config interface via netlink
* snoop DHCP ACKs to improve DAT cache efficiency
* bugs squashed:

  - avoid potential reference counter underflows and use-after free errors for
    several objects
  - fix GCC warning when B.A.T.M.A.N. V is build in but cfg80211 is not
    available
  - reject too small VLAN packets before they are processed further

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-03-28 19:50:25 +01:00
Adrian Schmutzler 1a22e00eeb batman-adv: Fix uci commit target
Although batman-adv config is cycled in config_foreach, changes
are made in the network config. Thus, this one has to be committed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-03-19 19:49:27 +01:00
Sven Eckelmann 54af5a209e batman-adv: Split batadv proto in meshif and hardif part
batman-adv allows to configure three different objects:

* batadv hardif

  - network interface used by batadv meshif to transport the batman-adv
    packets
  - its master interface is set to the batadv meshif

* batadv (meshif/softif)

  - virtual interface that emulates a normal 802.3 interface on top
  - encapsulates traffic and forwards it via the batadv hardifs

* batadv vlan

  - potential VLAN ID on top of batadv meshif
  - allows filtering of traffic from specific VIDs

While batadv vlan objects were already represented as an own proto
"batadv_vlan", the batadv meshif could never be fully configured using
/etc/config/network. Instead, parts of its configuration were stored in
/etc/config/batman_adv and some in the interfaces with the "batadv" proto.

To increase the confusion, the "batadv" proto wasn't used to define the
batadv meshif but to identify batadv (slave) hardifs. The batman-adv
meshifs were also never created directly but only when a hardif was
configured. The actual modification of the configuration settings was then
applied using a hotplug script hack. The batadv meshif network interface
could therefore only be created when an hardif was available and not
manipulated with ifup/ifdown. Also `/etc/init.d/network reload` didn't
modify the batadv meshif interface configuration correctly.

The "batadv" is now renamed to "batadv_hardif" and a new "batadv" proto is
used to configure the main (meshif) network interface with all its
configuration.

A simple network configuration with WiFi & ethernet interfaces and static
IP on top of bat0 would look like:

  # batadv meshif bat0
  config interface 'bat0'
  	option proto 'batadv'
  	option routing_algo 'BATMAN_IV'
  	option aggregated_ogms 1
  	option ap_isolation 0
  	option bonding 0
  	option fragmentation 1
  	#option gw_bandwidth '10000/2000'
  	option gw_mode 'off'
  	#option gw_sel_class 20
  	option log_level 0
  	option orig_interval 1000
  	option bridge_loop_avoidance 1
  	option distributed_arp_table 1
  	option multicast_mode 1
  	option network_coding 0
  	option hop_penalty 30
  	option isolation_mark '0x00000000/0x00000000'

  # add *single* wifi-iface with network bat0_hardif_wlan as hardif to bat0
  config interface 'bat0_hardif_wlan'
  	option mtu '1536'
  	option proto 'batadv_hardif'
  	option master 'bat0'
  	# option ifname is filled out by the wifi-iface

  # add eth0 as hardif to bat0
  config interface 'bat0_hardif_eth0'
  	option proto 'batadv_hardif'
  	option master 'bat0'
  	option ifname 'eth0'
  	option mtu '1536'

  # configure IP on bat0
  config interface 'bat0_lan'
  	option ifname 'bat0'
  	option proto 'static'
  	option ipaddr '192.168.1.1'
  	option netmask '255.255.255.0'
  	option ip6assign '60'

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-03-07 17:01:09 +01:00
Sven Eckelmann 5882b6049d batman-adv: use batctl for configuration of hop_penalty
hop_penalty is the last remaining setting which is directly writing to
sysfs instead of using a implementation (sysfs vs. netlink) abstraction
layer. batctl now provides a wrapper function that allows the script to
directly use it to take care of communicating with the driver.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 22:49:56 +01:00
Sven Eckelmann 7d973599ef batman-adv: use batctl for configuration of gw_mode
The batctl tool should be used for modifying settings in the batman-adv
driver to keep the scripts consistent and allow to use the correct way of
communicating with the kernel (sysfs vs. netlink).

The gw_mode, gw_bandwidth and gw_sel_class options are all handled by
the same gw_mode command in batctl and thus have to be combined depending
on the "gw_mode" value.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 22:46:21 +01:00
Sven Eckelmann ad27ee7f9a batman-adv: Drop cfg80211_get_station memset workaround
The actual memset fix for cfg80211_get_station's sinfo is already part of
the mac80211 package and doesn't have to be shipped anymore with
batman-adv.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:40:11 +01:00
Sven Eckelmann fc37a1aa4d batman-adv: Drop compat-hack for __poll_t
__poll_t is already defined by the mac80211's backports and
doesn't have to be redefined in the compat-hacks.h.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:38:35 +01:00
Sven Eckelmann df9d2719fa batman-adv: Drop compat-hack for from_timer
from_timer is already defined by the mac80211's backports and
doesn't have to be redefined in the compat-hacks.h.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:37:54 +01:00
Sven Eckelmann ae9c14e8b0 batman-adv: Drop compat-hack for skb_put*
skb_put* is already defined by the mac80211's backports and
doesn't have to be redefined in the compat-hacks.h.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:35:39 +01:00
Sven Eckelmann 3f0a7c4880 batman-adv: Drop compat-hack for nla_put_u64_64bit
nla_put_u64_64bit is already defined by the mac80211's backports and
doesn't have to be redefined in the compat-hacks.h.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:24:40 +01:00
Sven Eckelmann 89bc1bc1a1 batman-adv: Drop compat-hack for netif_trans_update
netif_trans_update is already defined by the mac80211's backports and
doesn't have to be redefined in the compat-hacks.h.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:22:22 +01:00
Sven Eckelmann 502d1232f7 batman-adv: Drop redefinition of NL80211_STA_INFO_EXPECTED_THROUGHPUT
NL80211_STA_INFO_EXPECTED_THROUGHPUT is defined by the mac80211 package and
doesn't have to be redefined in the compat-hacks.h.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:19:42 +01:00
Sven Eckelmann 203ee34d9c batman-adv: Drop unused compat-hacks.patch
The linux/build_bug.h is already provided by mac80211's backports. It is
not needed anymore to adjust the includes to use the older linux/bug.h

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-22 20:04:35 +01:00
Sven Eckelmann e6fc697d41 batman-adv: upgrade package to latest release 2019.0
* support latest kernels (3.16 - 5.0)
* coding style cleanups and refactoring
* allow to enable debug tracing without full batman-adv debugfs support
* enable inconsistency reporting for most netlink dump commands
* bugs squashed:

  - avoid unnecessary kernel warning (panic) during detection of interface loops
  - work around incorrect ethernet header offset in transmit code path

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-02 14:04:09 +01:00
Sven Eckelmann 498463cd59 batman-adv: use batctl for configuration
The batctl binary is currently optional for batman-adv installations. But
new configuration settings will only be exposed via generic netlink. The
batctl tool will therefore be required to modify them.

batctl must therefore no longer depend on batman-adv but batman-adv must
depend on batctl. Some already implemented settings are already moved to
batctl.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-01-27 15:31:37 +01:00
Sven Eckelmann 4167ad2c62 batman-adv: upgrade package to latest release 2018.4
* support latest kernels (3.16 - 4.20)
* coding style cleanups and refactoring
* improve tx performance by avoiding unnecessary locking
* add help messages regarding deprecation of debugfs files
* support for debug message tracepoints
* explicit ELP padding to allow TVLVs in the future
* bugs squashed:

  - fix skb_over_panic for merged fragments with small tailroom

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-11-14 21:50:38 +01:00
Sven Eckelmann 9bc898b8f4 batman-adv: Re-add kmod-lib-crc16 back to dependency line
The OpenWrt dependency builder cannot extract the crc16 dependency from
the KMOD_BATMAN_ADV_BLA dependencies. They have to be specified directly in
the OpenWrt Makefile's DEPENDS line to avoid error when BLA is enabled:

  Package kmod-batman-adv is missing dependencies for the following libraries:
  crc16.ko

Reported-by: Lech Perczak <lech.perczak@gmail.com>
Fixes: 0db66160aa ("batman-adv: Sync config options with kernel Kconfig")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-22 12:34:32 +02:00
Sven Eckelmann c3b60d4c84 batman-adv: Remove unused dependency kmod-crypto-crc32c
The translation table code from batman-adv is only using the function
crc32c which is part of kmod-lib-crc32c. The kmod-crypto-crc32c is then
only used by kmod-lib-crc32c but not batman-adv.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 17:41:53 +02:00
Sven Eckelmann 6a25fd5ce5 batman-adv: Use the kernel style Kconfig symbols
Kernel modules like ath9k and ath10k are using the same Kconfig option
symbols as used in the kernel. This makes it easier to share them between
these two projects. A similar approach should be used for the batman-adv
module.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 17:41:52 +02:00
Sven Eckelmann 0db66160aa batman-adv: Sync config options with kernel Kconfig
The kernel already provides all available kernel options for batman-adv and
even includes more verbose descriptions of each option. Importing this
Kconfig (with minor adjustments) file as Config.in allows to share most
information between kernel and OpenWrt.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 17:41:52 +02:00
Sven Eckelmann 45c12f406f batman-adv: Disable MCAST during compilation
The multicast optimization compile option is disabled by default in the
Kconfig of batman-adv. The out-of-tree module should keep this setting in
sync and thus has to also disable the build of multicast optimization by
default.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 16:58:01 +02:00
Sven Eckelmann c5092c6e78 batman-adv: Order Kconfig config symbols like kernel
The options in the kernel Kconfig have a different order than the one in
the OptionWrt Config.in. This makes it unnecessary hard to compare these
two files.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 16:50:23 +02:00
Sven Eckelmann 726b00dc9f batman-adv: Add DEBUG_LOG -> DEBUGFS dependency
The debug log is only available when the debugfs is also enabled. This
must be reflected in Kconfig to avoid incompatible selection of batman-adv
options.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 16:07:42 +02:00
Sven Eckelmann 542a63720f batman-adv: Add openwrt revision to internal version
OpenWrt is using a modified version of the software and these modifications
may introduce extra bugs (or behavior changes). It is also patched for
stable releases instead of switching to new releases. The revision should
therefore be added to the version number to make it easier understandable
which modified version the user may have installed.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-07 13:31:01 +02:00
Sven Eckelmann 8112737cdc batman-adv: Fix search for cfg80211 module symbols
The Module.symvers with the exported symbols of all other kernel modules in
OpenWrt is usually placed in the main source directory of the package. But
the actual sources for batman-adv are found in net/batman-adv. OpenWrt must
therefore be informed to move it to this subdirectory or otherwise modpost
will fail to find the symbols

  WARNING: "cfg80211_get_station" [.../batman-adv-2018.3/net/batman-adv/batman-adv.ko] undefined!

The dependency will then be missing in the .modinfo depends= option and
thus it the kernel module loader will not correctly load the cfg80211.ko
during bootup.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-07 13:29:24 +02:00
Sven Eckelmann 003607ac1e batman-adv: Rebuild automatically on mac80211 changes
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-07 10:42:12 +02:00
Sven Eckelmann 02e3cb6db9 batman-adv: upgrade package to latest release 2018.3
* support latest kernels (3.16 - 4.19)
* coding style cleanups and refactoring
* enable the DAT by default for the in-tree Linux module
* bugs squashed:

  - fix segfault when writing to sysfs files under batman_adv/ with
    CONFIG_BATMAN_ADV_DEBUG enabled
  - avoid information leakage in probe ELP packets
  - adjust reference counters when queue_work fails
  - prevent duplicated entries in various lists

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-09-15 10:20:02 +02:00
Sven Eckelmann afba8ae2c0 batman-adv: upgrade package to latest release 2018.2
* support latest kernels (3.16 - 4.18)
* dropped support for kernels < 3.16 (note the removed build directory)
* coding style cleanups and refactoring
* avoid old nodes disabling multicast optimizations completely
* disable ethtool based B.A.T.M.A.N. V speed detection for virtual interfaces
* enable B.A.T.M.A.N. V compilation by default
* disable debugfs support by default
* bugs squashed:

  - fix TT sync flags for intermediate TT responses
  - avoid race in TT TVLV allocator helper
  - prevent TT request storms by not sending inconsistent TT TVLVs
  - fix best gw refcnt after netlink dump
  - adjust debugfs paths for interfaces after a namechange
  - fix single entry TT non-sync flag storage
  - fix multicast TT issues with bogus ROAM flags
  - work around insufficient memory initialization in cfg80211's station info

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 21:23:54 +02:00
Sven Eckelmann 7a9336380a batman-adv: Simplify installation of files
It is not necessary to install each file manually to the target path. A
simple recursive copy is enough.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 21:23:54 +02:00
Sven Eckelmann 247499d2b0 batman-adv: Drop unused clean rule
The path $(BUILD_DIR)/$(PKG_NAME) is not used anymore. The rule can be
removed and the OpenWrt build system takes care of the removal of the build
directory.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 21:23:54 +02:00
Sven Eckelmann 643e41c9d6 batman-adv: Drop manual installation of compat-hacks.h
OpenWrt is able since a while to automatically install all files in ./src/
to the PKG_BUILD_DIR. It is no longer necessary to provide special
Build/Prepare rules to do so.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 21:23:54 +02:00
Sven Eckelmann b30eb65d2f batman-adv: Provide default settings examples for bat0
Users may want to know what options can be specified and in which form they
have to specified. A commented out list of settings is helpful here while
making it not necessary to copy the default settings from batman-adv to
this config all the time.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 20:37:53 +02:00
Sven Eckelmann 0726085a2d batman-adv: Remove unused option "interfaces" in config
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 20:25:23 +02:00
Sven Eckelmann 69d016ebe5 batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
All tools which were known to the batman-adv development team are
supporting the batman-adv netlink interface since a while. Also debugfs is
not supported for batman-adv interfaces in any non-default netns. Thus
disabling CONFIG_BATMAN_ADV_DEBUGFS by default should not cause problems on
most systems. It is still possible to enable it in case it is still
required in a specific setup.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 20:21:06 +02:00
Sven Eckelmann ccc93a4c45 batman-adv: Remove deprecated compat helpers
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 20:21:06 +02:00
Sven Eckelmann 74e9124611 batman-adv: Add compat for link_ksettings->base.autoneg
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 20:21:06 +02:00
Sven Eckelmann 846efa2305 batman-adv: Load module with AutoProbe
cfg80211 is loaded by kmodloader after the modules with a priority
(AutoLoad) are loaded. batman-adv should therefore also be loaded at that
time and must not load cfg80211 itself. The information in the ELF header
are enough for kmodloader to load these two modules in the correct order.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-07-17 20:21:06 +02:00
Sven Eckelmann 87cba7f899 batman-adv: add patches from 2018.1-maint 2018-06-12
* compat: initialize sinfo in cfg80211_get_station
* Avoid storing non-TT-sync flags on singular entries too
* Fix multicast TT issues with bogus ROAM flags

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-06-12 22:54:22 +02:00
Sven Eckelmann 2dfb228764 batman-adv: add patches from 2018.1-maint 2018-06-03
* Avoid race in TT TVLV allocator helper
* Fix TT sync flags for intermediate TT responses
* prevent TT request storms by not sending inconsistent TT TLVLs
* don't implement skb_postpush_rcsum() for linux >=4.4.47
* Fix bat_ogm_iv best gw refcnt after netlink dump
* Fix bat_v best gw refcnt after netlink dump
* Fix debugfs path for renamed hardif
* Fix debugfs path for renamed softif

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-06-03 18:43:22 +02:00
Sven Eckelmann 455a54207c batman-adv: upgrade package to latest release 2018.1
* support latest kernels (3.2 - 4.17)
* coding style cleanups and refactoring
* add DAT cache and multicast flags netlink support
* avoid redundant multicast TT entries
* bugs squashed:

  - update data pointers after skb_cow()
  - fix header size check in batadv_dbg_arp()
  - fix skbuff rcsum on packet reroute
  - fix multicast-via-unicast transmission with AP isolation
  - fix packet loss for broadcasted DHCP packets to a server
  - fix multicast packet loss with a single WANT_ALL_IPV4/6 flag

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-04-25 21:18:35 +02:00
Sven Eckelmann 3bb75b0035 batman-adv: upgrade package to latest release 2018.0
* support latest kernels (3.2 - 4.16)
* coding style cleanups and refactoring
* mark licenses clearer, change UAPI header from ISC to MIT
* bugs squashed:

  - fix packet checksum handling in receive path
  - fix handling of large number of interfaces
  - fix netlink dumping of gateways and BLA claims+backbones

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-02-27 13:59:03 +01:00
Sven Eckelmann 467f0b61e2 batman-adv: Fix missing function name for timer_setup
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-12-26 11:52:22 +01:00
Sven Eckelmann d046353539 batman-adv: upgrade package to latest release 2017.4
* support latest kernels (3.2 - 4.15)
* coding style cleanups and refactoring
* documentation cleanup
* bugs squashed:

  - avoid spurious warnings from bat_v neigh_cmp implementation
  - fix check of gateway availability in B.A.T.M.A.N. V
  - fix locking for bidirectional TQ check counters
  - remove leak of stack bits in fragmentation header priority

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-12-05 19:11:26 +01:00
Sven Eckelmann 14daec66ef batman-adv: upgrade package to latest release 2017.3
* support latest kernels (3.2 - 4.14)
 * coding style cleanups and refactoring
 * bugs squashed:
   - fix TT sync flag inconsistencies
   - ignore invalid throughput values from wifi interfaces

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-09-28 18:42:27 +02:00
Sven Eckelmann 7d5648775a batman-adv: Fix conflicts with compat-wireless backports-4.14-rc1
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-09-18 14:21:49 +02:00
Sven Eckelmann 187937b35a batman-adv: Prevent FTBFS when redefining ether_setup
batman-adv must make sure that ether_setup is already declared via
linux/netdevice.h before the preprocessor can patch the use of it in
batman-adv. Otherwise it is tried to also patch the declaration of
ether_setup.

Fixes: 8da2f5cbb1 ("batman-adv: upgrade package to latest release 2017.2")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-08-12 08:54:47 +02:00
Sven Eckelmann 77a88d5d0b batman-adv: fix TT sync flag inconsistencies
This patch fixes an issue in the translation table code potentially
leading to a TT Request + Response storm. The issue may occur for nodes
involving BLA and an inconsistent configuration of the batman-adv AP
isolation feature. However, since the new multicast optimizations, a
single, malformed packet may lead to a mesh-wide, persistent
Denial-of-Service, too.

The issue occurs because nodes are currently OR-ing the TT sync flags of
all originators announcing a specific MAC address via the
translation table. When an intermediate node now receives a TT Request
and wants to answer this on behave of the destination node then this
intermediate node now responds with an altered flag field and broken
CRC. The next OGM of the real destination will lead to a CRC mismatch
and triggering a TT Request and Response again.

Furthermore, the OR-ing is currently never undone as long as at least
one originator announcing the according MAC address remains, leading to
the potential persistency of this issue.

This patch fixes this issue by storing the flags used in the CRC
calculation on a a per TT orig entry basis to be able to respond with
the correct, original flags in an intermediate TT Response for one
thing. And to be able to correctly unset sync flags once all nodes
announcing a sync flag vanish for another.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-07-29 10:18:28 +02:00
Sven Eckelmann d97cd1b8c1 batman-adv: Remove outdated SVN $Id$ placeholder
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-07-29 09:28:47 +02:00
Sven Eckelmann 8da2f5cbb1 batman-adv: upgrade package to latest release 2017.2
* support latest kernels (3.2 - 4.13)
 * avoid bridge loop detection mac addresses in translation tables
 * coding style cleanups and refactoring
 * bugs squashed:
   - ignore invalid throughput values from wifi interfaces

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-07-29 09:26:40 +02:00
Sven Eckelmann e7ccf38057 batman-adv: upgrade package to latest release 2017.1
* support latest kernels (3.2 - 4.12)
 * bridge loop avoidance improvements for various corner cases
 * reduction of maximum fragment size
 * coding style cleanups and refactoring
 * bugs squashed:
   - fix rx packet/bytes stats on local DAT ARP reply

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-05-25 17:02:31 +02:00
Sven Eckelmann 1c0419755d batman-adv: Add bugfixes for 2017.0.1
* batman-adv: average: change to declare precision, not factor
 * batman-adv: Keep fragments equally sized
 * batman-adv: Initialize gw sel_class via batadv_algo

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-03-04 17:49:18 +01:00
Sven Eckelmann f5b1fe1a60 batman-adv: upgrade package to latest release 2017.0
* support latest kernels (3.2 - 4.11)
 * remove bridge loop avoidance addresses from translation table
 * allow to build B.A.T.M.A.N. V without cfg80211 integration on Linux <
 * 3.16
 * coding style cleanups and refactoring
 * bugs squashed:
   - fix interface reference counter on fragmentation errors
   - avoid double free on fragment merge error
   - fix support for up to 16 fragments
   - fix build of multicast compatibility code on some architectures

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-02-28 19:35:09 +01:00
Sven Eckelmann 0a4df2c301 batman-adv: add patches from 2016.5-maint 2017-02-21
* batman-adv: Fix double free during fragment merge error
 * batman-adv: Fix transmission of final, 16th fragment

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-02-26 15:17:46 +01:00
Simon Wunderlich 3c466ebe40 Merge pull request #269 from ecsv/batadv-fixes
batman-adv: maint patch import + settings fixes
2017-02-03 19:06:32 +01:00
elektra42 713ea82014 Merge pull request #261 from ecsv/batmand-git
batman: Switch maintainers and get batmand/vis packages from git
2017-02-03 18:28:20 +01:00
Sven Eckelmann 8a66ed1857 batman-adv: Remove non-existing setting "vis_mode"
There is no vis_mode in the batman-adv kernel module since batman-adv
2014.0.0. So don't expose such a setting in uci.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2017-01-30 15:02:53 +01:00
Sven Eckelmann 6c1a1a0666 batman-adv: Fix "aggregated_ogms" setting
The new setting for aggregated_ogms was read from the correct config key.
But the setting was applied to the wrong file. Also the value to set was
not read from the correct variable.

Reported-by: Edward Beech <initialed85@gmail.com>
Fixes: 2d654c0af1 ("batman-adv: upgrade package to latest release 2012.0.0")
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2017-01-30 15:02:53 +01:00
Sven Eckelmann 0e8b0976f5 batman-adv: add patches from 2016.4-maint 2017-01-04
* batman-adv: Decrease hardif refcnt on fragmentation send error

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2017-01-30 15:02:53 +01:00
Sven Eckelmann 438114cc26 batman-adv: Add sha256 PKG_HASH for LEDE
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2017-01-30 15:02:53 +01:00
Marek Lindner 1f2e4d7d03 batman-adv: compile batman v by default
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2017-01-29 19:46:17 +08:00
Matthias Schiffer 8018159e9c
batman-adv: use kernel-specific PKG_BUILD_DIR
The batman-adv Makefile set a PKG_BUILD_DIR outside of KERNEL_BUILD_DIR;
this could lead to batman-adv not being rebuilt when switching targets and
thus kernel configurations. This resulted in ABI mismatches and
occasionally broke the build with messages like the following:

    Package kmod-batman-adv is missing dependencies for the following libraries:
    crc16.ko

Instead of setting a better PKG_BUILD_DIR ourselves, we can just remove
the explicit PKG_BUILD_DIR definition and include kernel.mk before
package.mk to get the default definition used by other kernel module
packages.

Reported-by: David Lutz <kpanic@hirnduenger.de>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-01-27 13:39:10 +01:00
Sven Eckelmann 5e6eede6f3 batman-adv: Change maintainer to Simon Wunderlich
Marek Lindner forwarded all recent requests regarding the package changes
to Simon. He also asked that further changes should be handled directly
without waiting for him.

Simon Wunderlich already has write access to the repository and is
therefore well prepared to take over the role of the maintainer.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-01-23 19:47:30 +01:00
Sven Eckelmann a80e868772 batman-adv: upgrade package to latest release 2016.5
* support latest kernels (3.2 - 4.10)
 * change installation path back to $INSTALL_MOD_DIR/updates/net/batman-adv
 * add simple (re)broadcast avoidance
 * reduce multicast TT and TVLV update delays under B.A.T.M.A.N. V
 * support B.A.T.M.A.N. V throughput detection when using VLANs on top of WiFi
 * improve documentation of sysfs and debugfs files
 * coding style cleanups and refactoring
 * bugs squashed:
   - detect missing primaryif during tp_send as error
   - fix re-adding of previously removed interfaces via rtnetlink
   - fix rare race conditions on interface removal
   - handle allocation error when generating TT responses

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-12-16 10:00:44 +01:00
Sven Eckelmann 3e7f211fee batman-adv: Add get_link_net compat code for Linux < 4.0.0
LEDE is still using Linux 3.18 on some systems. Allow to build batman-adv
for it by not checking the netns of a possible netdev link during the
batadv-on-batadv check.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-12-02 15:48:47 +01:00
Sven Eckelmann 8387f7c9d4 batman-adv: add patches from 2016.4-maint 2016-12-02
* batman-adv: Install module in $INSTALL_MOD_DIR/updates/net/batman-adv
 * batman-adv: Revert "fix splat on disabling an interface"
 * batman-adv: Detect missing primaryif during tp_send as error
 * batman-adv: Check for alloc errors when preparing TT local data

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-12-02 15:48:18 +01:00
Sven Eckelmann 215d6b834f batman-adv: upgrade package to latest release 2016.4
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-10-28 18:03:42 +02:00
Sven Eckelmann 549909f89d batman-adv: upgrade package to latest release 2016.3
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-09-30 10:04:48 +02:00
lindnermarek 96d0019999 Merge pull request #221 from NeoRaider/batman-adv-version
batman-adv: move CONFIG_MODULE_STRIPPED hack to compat-hacks.h
2016-08-24 17:42:10 +08:00
Matthias Schiffer 71f835fdeb
batman-adv: move CONFIG_MODULE_STRIPPED hack to compat-hacks.h
The CONFIG_MODULE_STRIPPED hack broke some time ago, as it is undefined too
late (after the headers using it have been included by compat-hacks.h).

Undefine CONFIG_MODULE_STRIPPED at the top of compat-hacks.h instead to
make the module version available to batctl again.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2016-08-09 02:20:34 +02:00
Sven Eckelmann 50c28dd9c5 batman-adv: Exchange include order for uapi header files
The build of netlink.c in batman-adv 2016.3 will fail because the
definition of GENL_NAMESIZE and similar things are missing. This is is
caused by an incorrect order of backports and non-backports header files
mixed up with uapi and non-uapi header files. Parts of the header files
would not get included by include_next because it not anymore in the
remaining search paths.

Reported: Marek Lindner <marek.lindner@open-mesh.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-07-08 12:02:41 +02:00
Marek Lindner a4eae82c15 batman-adv: update package release to allow pkg upgrade
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-07-06 21:36:38 +08:00
Sven Eckelmann 7f6956b5bb batman-adv: Fix speedy join in gateway client mode
Speedy join only works when the received packet is either broadcast or an
4addr unicast packet. Thus packets converted from broadcast to unicast via
the gateway handling code have to be converted to 4addr packets to allow
the receiving gateway server to add the sender address as temporary entry
to the translation table.

Not doing it will make the batman-adv gateway server drop the DHCP response
in many situations because it doesn't yet have the TT entry for the
destination of the DHCP response.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-07-05 12:13:44 +02:00
Sven Eckelmann af8eeab86f batman-adv: Add reference counting + nullptr fixes
* Avoid nullptr dereference in bla after vlan_insert_tag
 * Avoid nullptr dereference in dat after vlan_insert_tag
 * Avoid tt_req_node list put for unhashed entry
 * Fix orig_node_vlan leak on orig_node_release
 * Fix non-atomic bla_claim::backbone_gw access
 * Fix reference leak in batadv_find_router
 * Free last_bonding_candidate on release of orig_node

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-07-05 12:12:07 +02:00
Sven Eckelmann fd4a2d7b6d batman-adv: upgrade package to latest release 2016.2
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-06-09 19:14:57 +02:00
Alexander Couzens 73da6b297e batman-adv: remove DEPENDS:=kmod-crypto-core
kmod-crypto-core was removed in openwrt/trunk svn 46820 and all
kconfig's are now built-in.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2016-06-05 03:51:02 +02:00
Marek Lindner 8dec3dc38b batman-adv: 2016.1 bugfixes & stability updates
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-07 20:42:44 +08:00
Marek Lindner 6d329737f9 batman-adv: revert partial cfg80211 kernel dependency
The entire batman-adv code relies on the kernel backports introduced
by the mac80211 package.

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-06 00:06:46 +08:00
Marek Lindner 006b1918e3 batman-adv: autoload cfg80211 kernel dependency
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-05 21:49:22 +08:00
Sven Eckelmann 4c3eecfac3 batman-adv: Add B.A.T.M.A.N. V support
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-04-21 15:48:53 +02:00
Sven Eckelmann 6363b1ddc5 batman-adv: Allow to select routing algorithm
The network config section for proto batadv now allows to select the
routing algorithm via the option routing_algo. This allows to chose between
BATMAN_IV and BATMAN_V when BATMAN_V is released. This option is only
useful when a new batman-adv device is created and not when only a device
is added to an already existing batman-adv device.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-04-21 15:48:40 +02:00
Sven Eckelmann 0cdf3ba21c batman-adv: upgrade package to latest release 2016.1
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-04-21 15:48:27 +02:00
Sven Eckelmann f8dd2baaa0 batman-adv: Move compat-hacks to separate file
The content of this file should actually be included somehow in
backport.git so it will become part of the mac80211 package. Still keep
this for now in a separate file so it is easier to extract them.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-03-25 11:12:47 +01:00
Sven Eckelmann 758d919870 batman-adv: Use the mac80211 compat layer
BATMAN_V (in the upcoming release) will use structures from the mac80211
package. These structures can be incompatible to the structures defined in
the header of the kernel. This can lead to weird problems like stack
overflows or memory corruptions.

To avoid this, the batman-adv has to be compiled against the mac80211
headers instead of the kernel headers. But this requires that the
compatibility headers of compat-wireless are used. So the batman-adv
compatibility layer has (mostly) be removed and instead the
compat-wireless/mac80211 compat layer has to be used.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-03-25 08:02:11 +01:00
Sven Eckelmann 53a921be2b batman-adv: upgrade package to latest release 2016.0
Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
2016-01-19 17:45:50 +01:00
Sven Eckelmann 0e7b291a54 batman-adv: Switch to HTTPS version of links
open-mesh.org and its subdomains can only be accessed via HTTPS. HTTP-only
requests are currently redirected automatically to HTTPS but references
to it should be only https.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-01-19 17:42:46 +01:00
Marek Lindner 0db26614ec batman-adv: upgrade package to latest release 2015.2
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2015-12-28 07:50:16 +08:00
Marek Lindner d34224e9f0 batman-adv: 2015.1 bugfixes & stability updates
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2015-09-06 16:53:06 +08:00
Marek Lindner 99a3f8dcb5 batman-adv: upgrade package to latest release 2015.1
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2015-08-05 03:00:59 +08:00
Marek Lindner 96867471b7 batman-adv: 2015.0 bugfixes & stability updates
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2015-07-07 16:51:36 +08:00