Commit Graph

125 Commits

Author SHA1 Message Date
Sven Eckelmann 04bbb0a87e batman-adv: Drop support for kernel < 5.15
OpenWrt master is no longer providing any kernels older than 5.15. Just
drop the compat-hacks/patches for older kernels to make it easier to
maintain the package.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2023-05-27 12:15:47 +02:00
Sven Eckelmann 6afc0452c2 batman-adv: update to version 2023.1
* support latest kernels (4.14 - 6.4)
* drop single unicast transfer optimization for unsnoopable IP addresses
* prepare infrastructure for multicast packets with multiple unicast destination
  addresses

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2023-05-27 12:09:02 +02:00
Nick Hainke 3e96c851a7 treewide: remove AUTORELEASE
OpenWrt/packages removed AUTORELEASE treewide. Remove it also in the
routing feed.

This is just copied from [0] with modification to the sed cmd because it
was not working for the routing feed:

The following temporary change was made to the core:

diff --git a/rules.mk b/rules.mk
index 57d7995d4fa8..f16367de87a8 100644
--- a/rules.mk
+++ b/rules.mk
@@ -429,7 +429,7 @@ endef
 abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))

 COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
-AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))
+AUTORELEASE = $(if $(DUMP),0,$(shell sed -i "s/\$$(AUTORELEASE)/$(call commitcount,1)/" $(CURDIR)/Makefile))

 all:
 FORCE: ;

And this command used to fix affected packages:

for i in $(cd feeds/routing; git grep -l PKG_RELEASE:=.*AUTORELEASE | \
                              sed 's/\/Makefile$//';);
do
  make package/$i/download
done

[0] - 0c10c224be

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-04-27 17:14:16 +02:00
Sven Eckelmann b4034e4ae1 batman-adv: update to version 2023.0
* support latest kernels (4.14 - 6.2)

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2023-01-26 22:29:55 +01:00
Sven Eckelmann 081291592e batman-adv: update to version 2022.3
* support latest kernels (4.9 - 6.1)
* coding style cleanups and refactoring
* bugs squashed:

  - limit the minimum MTU of hard-interface to avoid
    "Forced to purge local tt entries" errors

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-10 21:44:20 +01:00
Sven Eckelmann fb41ed5cc8 batman-adv: Rebuild on CONFIG_BATMAN_ADV_* changes
The buildsystem doesn't know that the KernelPackage/*/config kconfig
symbols are related to the batman-adv package build. It is necessary to
explicitly define it via PKG_CONFIG_DEPENDS.

Fixes: 522ce8dfdb ("batman-adv: rename folder name to match project & package name")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-10-23 10:16:07 +02:00
Sven Eckelmann 4a2b53b10d batman-adv: update to version 2022.2
* support latest kernels (4.9 - 5.19)

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-07-26 21:55:40 +02:00
Sven Eckelmann b65a8ca03a batman-adv: update to version 2022.1
* support latest kernels (4.9 - 5.18)
* bugs squashed:

  - resolve "time-of-check-time-of-use" race condition when checking the
    network namespace of a lower device
  - fix sanity check of network devices in different namespaces with
    colliding IDs
  - prevent transmission errors after splitting large GRO packets into
    smaller fragments

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-05-06 22:09:55 +02:00
Sven Eckelmann 823acb605b batman-adv: Allow parallel builds
The build system of this package is written in a way that it is safe to run
the make steps in parallel. The build time can be reduced slightly on
modern systems.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-02-19 09:12:56 +01:00
Sven Eckelmann 55a8827ad8 batman-adv: update to version 2022.0
* support latest kernels (4.9 - 5.17)
* dropped support for kernels < 4.9
* coding style cleanups and refactoring
* allow netlink usage in unprivileged containers
* bugs squashed:

  - don't send link-local multicast to mcast routers

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-02-03 19:47:44 +01:00
Hendrik Borghorst 523821c195 batman-adv: Prevent use from libc headers to not build with BIG_ENDIAN
Commit 97d35a552ec5b6ddf7923dd2f9a8eb973526acea of musl introduced the
macros __LITTLE_ENDIAN and __BIG_ENDIAN in alltypes.h. These are pulled
into the compilation of batman-adv. This has the side effect that the
function is_multicast_ether_addr of etherdevice.h in Linux kernel is
compiled as the big endian version and so fails to work properly on
little endian devices.

This commits prevents pulling in header files of musl libc similar to
OpenWRT commit 9ac47ee46918c45b91f4e4d1fa76b1e26b9d57fe

Signed-off-by: Hendrik Borghorst <hendrikborghorst@gmail.com>
2021-11-27 13:53:53 +01:00
Sven Eckelmann ca6c9edc3e batman-adv: update to version 2021.4
* support latest kernels (4.4 - 5.16)
* coding style cleanups and refactoring
* bugs squashed:

  - fix error handling during interface initialization

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-11-19 17:40:29 +01:00
Simon Wunderlich c28f02f679
Revert "batman-adv: update packages to version 2021.4" 2021-11-19 17:35:37 +01:00
Sven Eckelmann 260e16b32a batman-adv: update to version 2021.4
* support latest kernels (4.4 - 5.16)
* coding style cleanups and refactoring
* bugs squashed:

  - fix error handling during interface initialization

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-11-19 16:55:58 +01:00
Sven Eckelmann a7b79a1d4f batman-adv: update to version 2021.3
* support latest kernels (4.4 - 5.15)
* coding style cleanups and refactoring
* reduced memory copy overhead when sending broadcasts

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-09-14 21:14:11 +02:00
Sven Eckelmann 47cd2a4b62 batman-adv: update to version 2021.2
* support latest kernels (4.4 - 5.14)
* coding style cleanups and refactoring
* add MRD + routable IPv4 multicast with bridges support
* rewrite of broadcast queuing
* bugs squashed:

  - avoid kernel warnings on timing related checks

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-08-20 13:14:22 +02:00
Sven Eckelmann 1c3233ca67 batman-adv: update to version 2021.1
* support latest kernels (4.4 - 5.13)
* coding style cleanups and refactoring
* bugs squashed:

  - correctly initialize padding when sending out translation table TVLVs

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-18 18:48:52 +02:00
Sven Eckelmann b6a5577fab batman-adv: use $(AUTORELEASE) for PKG_RELEASE
Use `$(AUTORELEASE)` variable rather than setting a PKG_RELEASE
on every commit manually.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-14 19:18:33 +02:00
Sven Eckelmann 6c81fc2916 batman-adv: upgrade package to latest release 2021.0
* support latest kernels (4.4 - 5.11)
* coding style cleanups and refactoring
* drop support for sysfs+debugfs
* allow to select routing algorithm during creation of interface
* bugs squashed:

  - allocate enough reserved room on fragments for lower devices

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-01-28 21:08:27 +01:00
Sven Eckelmann 39cf9f5b47 batman-adv: Drop compat code for Linux < 5.4
The lowest kernel version supported by OpenWrt at the moment is Linux 5.4.
It is therefore not required to have these dead code sections anymore.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-01-28 21:05:35 +01:00
Sven Eckelmann aca51f8149 batman-adv: upgrade package to latest release 2020.4
* support latest kernels (4.4 - 5.10)
* coding style cleanups and refactoring
* bugs squashed:

  - fix incorrect reroute handling of multicast packets
  - improve handling of multicast packets by bridge loop avoidance

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-10-27 14:46:11 +01:00
Sven Eckelmann c201b00922 batman-adv: upgrade package to latest release 2020.3
* support latest kernels (4.4 - 5.9)
* coding style cleanups and refactoring
* introduce a configurable per interface hop penalty
* bugs squashed:

  - avoid uninitialized chaddr when handling DHCP
  - fix own OGMv2 check in aggregation receive handling
  - fix "NOHZ: local_softirq_pending 08" warnings caused by BLA

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-08-25 20:09:34 +02:00
Sven Eckelmann 9852b614a2 batman-adv: upgrade package to latest release 2020.2
* support latest kernels (4.4 - 5.8)
* coding style cleanups and refactoring
* dropped support for kernels < 4.4
* re-enabled link speed detection for interfaces without auto negotiation

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-07-06 19:54:00 +02:00
Sven Eckelmann aa8705683e batman-adv: Provide mac80211's config settings
The mac80211 headers might depend on the actual configuration of mac80211
to generate an ABI compatible structure definition. batman-adv must
therefore include the header with these config definitions.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-05-19 15:11:35 +02:00
Sven Eckelmann 2f54cd50a3 batman-adv: use KERNEL_MAKE_FLAGS for kernel module compilation
It is easier to use the global define than to manually keep track of the
changes in the various kernel module makefiles in the main OpenWrt
repository and feeds.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-05-19 15:11:35 +02:00
Sven Eckelmann d6ba424d34 batman-adv: upgrade package to latest release 2020.1
* support latest kernels (3.16 - 5.7-rc2)
* coding style cleanups and refactoring
* bugs squashed:

  - fix reference leaks in throughput_override sysfs file
  - fix reference leak in B.A.T.M.A.N. V OGM error handling
  - fix network coding random weighting

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-04-24 19:30:11 +02:00
Sven Eckelmann 0aa846dec7 batman-adv: Drop compat-sources build
The compat-sources are no longer needed for kernels >= 4.4. Older kernel
versions are not used since a while in OpenWrt.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-04-24 19:01:20 +02:00
Sven Eckelmann cc0ce25bb0 batman-adv: Switch to OpenWrt package template
The OpenWrt routing feed was tried to be merged together with the OpenWrt
package feed. But they ended up being rejected due to formalities like the
slightly different package template. Just moving to the OpenWrt package
based one should simplify similar approaches in the future.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-03-07 18:51:17 +01:00
Sven Eckelmann 00de979415 batman-adv: replace SUBDIRS with M kernel build recipe
The SUBDIRS variable has been removed in kernel 5.4 and M or KBUILD_EXTMOD
has to be used instead.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-03-07 18:50:14 +01:00
Sven Eckelmann 05da6ef2ca batman-adv: upgrade package to latest release 2020.0
* support latest kernels (3.16 - 5.6)
* coding style cleanups and refactoring
* use wifi tx rates as fallback for the B.A.T.M.A.N. V throughput estimation
* disable deprecated sysfs support by default
* bugs squashed:

  - fix crash during the scheduling of OGMs for removed interfaces

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-03-07 18:50:13 +01:00
Simon Wunderlich 5544be5234
Merge pull request #529 from adrianschmutzler/openwrtversion
batman-adv and friends: improve version string
2019-12-15 16:00:16 +01:00
Sven Eckelmann 5bd07eb12b batman-adv: upgrade package to latest release 2019.5
* support latest kernels (3.16 - 5.5)
* coding style cleanups and refactoring
* bugs squashed:

  - fix DAT candidate selection on little endian systems

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-12-13 22:35:12 +01:00
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 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