Commit Graph

107 Commits

Author SHA1 Message Date
Sven Eckelmann 7448ab9d65 batman-adv: Fix missing include for backported 2020.4 patch
The build can fail in some configurations because the include for
batadv_send_skb_unicast was missing in batman-adv 2018.1.

Reported-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Fixes: c197ddb225 ("batman-adv: Merge bugfixes from 2020.4")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-10-27 15:49:57 +01:00
Sven Eckelmann c197ddb225 batman-adv: Merge bugfixes from 2020.4
* bla: fix type misuse for backbone_gw hash indexing
* mcast/TT: fix wrongly dropped or rerouted packets
* Add missing include for in_interrupt()
* mcast: fix duplicate mcast packets in BLA backbone from LAN
* mcast: fix duplicate mcast packets in BLA backbone from mesh
* mcast: fix duplicate mcast packets from BLA backbone to mesh

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-10-24 21:59:58 +02:00
Sven Eckelmann 71a7397822 batman-adv: Merge bugfixes from 2020.3
* Avoid uninitialized chaddr when handling DHCP
* Fix own OGM check in aggregated OGMs
* bla: use netif_rx_ni when not in interrupt context

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-08-25 20:38:30 +02:00
Sven Eckelmann 719709a03e batman-adv: Merge bugfixes from 2020.1
* fix batadv_nc_random_weight_tq
* Fix refcnt leak in batadv_show_throughput_override
* Fix refcnt leak in batadv_store_throughput_override
* Fix refcnt leak in batadv_v_ogm_process

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-04-24 21:03:09 +02:00
Sven Eckelmann 8f8ab76e18 batman-adv: Merge bugfixes from 2020.0
* Don't schedule OGM for disabled interface

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-03-06 20:59:02 +01:00
Sven Eckelmann 0d22982f30 batman-adv: Merge bugfixes from 2019.5
* fix DAT candidate selection on little endian systems

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-12-13 22:11:22 +01:00
Sven Eckelmann ee3264b6aa batman-adv: Merge bugfixes from 2019.4
* fix uninit-value in batadv_netlink_get_ifindex()
* Only read OGM tvlv_len after buffer len check
* Only read OGM2 tvlv_len after buffer len check
* Avoid free/alloc race when handling OGM2 buffer
* Avoid free/alloc race when handling OGM buffer
* Introduce own OGM2 buffer mutex
* Avoid OGM workqueue synchronous cancel deadlock

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-10-25 22:41:19 +02:00
Sven Eckelmann c07326c3ba 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:07:39 +02:00
Sven Eckelmann 145ba7f46a batman-adv: Merge bugfixes from 2019.2
* mcast: fix multicast tt/tvlv worker locking
* fix for leaked TVLV handler

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-05-23 19:53:52 +02:00
Sven Eckelmann 40b75193bc batman-adv: Reorder patches
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-05-23 19:08:04 +02:00
Simon Wunderlich e5fe4b63e8
Merge pull request #462 from ecsv/batadv-18.06
openwrt-18.06: batman-adv: Merge bugfixes from 2019.1
2019-03-29 13:33:01 +01:00
Sven Eckelmann ee2d981d00 batman-adv: Merge bugfixes from 2019.1
* fix uninit-value in batadv_interface_tx()
* Reduce claim hash refcnt only for removed entry
* Reduce tt_local hash refcnt only for removed entry
* Reduce tt_global hash refcnt only for removed entry

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-03-28 20:39:10 +01:00
Sven Eckelmann 42af8350c1 batman-adv: Refresh patches
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-11 11:24:47 +01:00
Simon Wunderlich ea345d16a6
Merge pull request #442 from ecsv/batadv-18.06
openwrt-18.06: batman-adv: Merge bugfixes from 2019.0
2019-01-16 10:00:25 +01:00
Sven Eckelmann 02313085ea batman-adv: Merge bugfixes from 2019.0
* Avoid WARN on net_device without parent in netns
* Force mac header to start of data on xmit

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-01-16 09:45:07 +01:00
Sven Eckelmann 7bf62cc8b5 batman-adv: Merge bugfixes from 2018.4
* Use explicit tvlv padding for ELP packets
* Expand merged fragment buffer for full packet

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-11-08 00:10:24 +01:00
Sven Eckelmann 1a83b56d47 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-14 16:04:31 +02:00
Sven Eckelmann 1ba424a4d0 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-10-14 16:04:31 +02:00
Sven Eckelmann b9656fb31e 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.1/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-14 16:04:31 +02:00
Sven Eckelmann 059d7266a9 batman-adv: Remove unused option "interfaces" in config
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 16:04:31 +02:00
Sven Eckelmann 3d5c2d06b6 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:04:31 +02:00
Sven Eckelmann a9a4b04b98 batman-adv: Rebuild automatically on mac80211 changes
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-10-14 15:31:24 +02:00
Sven Eckelmann ddef3900a4 batman-adv: Merge bugfixes from 2018.3
* Avoid probe ELP information leak
* Fix segfault when writing to throughput_override
* Fix segfault when writing to sysfs elp_interval
* fix backbone_gw refcount on queue_work() failure
* fix hardif_neigh refcount on queue_work() failure
* Prevent duplicated gateway_node entry
* Prevent duplicated nc_node entry
* Prevent duplicated softif_vlan entry
* Prevent duplicated global TT entry
* Prevent duplicated tvlv handler

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-09-15 11:19:36 +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