Commit Graph

40 Commits

Author SHA1 Message Date
Sven Eckelmann 9090aefa69 batman-adv: Provide teardown hook for batadv_vlan proto
The batadv_vlan proto doesn't need to do anything when it gets teared down.
But the scripts are still trying to call the teardown function of this
proto. This results in warnings like:

    daemon.notice netifd: batmesh1 (18940): ./batadv_vlan.sh: eval: line 37: proto_batadv_vlan_teardown: not found

Just providing a stub function avoids this log spam.

Fixes: #1044
Reported-by: Rani Hod <rani.hod@gmail.com>
Fixes: f5205d7d24 ("batman-adv: upgrade package to latest release 2014.2.0")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2024-02-05 09:04:42 +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 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 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 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
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 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 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 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 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 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 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 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 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 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 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 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 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
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 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
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 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
Marek Lindner f5205d7d24 batman-adv: upgrade package to latest release 2014.2.0
* remove batctl tool into separate package
 * support for vlan options added

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-06-07 13:33:28 +08:00
Marek Lindner 73764a009f batman-adv: add support for the isolation_mark option
With the introduction of the Extended Isolation component[1]
a new option is required by batman-adv: the isolation_mark.
This patch adds support for it in the configuration file

[1] http://www.open-mesh.org/projects/batman-adv/wiki/Extended-isolation

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-04-06 21:51:04 +08:00
Marek Lindner a6d6fa15cd batman-adv: upgrade package to latest release 2013.2.0
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2013-05-08 18:25:38 +08:00
Jo-Philipp Wich a0e2bb6a79 move batman-adv files to subdirectory 2013-04-18 18:54:15 +02:00