Commit Graph

61 Commits

Author SHA1 Message Date
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 5eda02f74c batman-adv: Refresh patches with quilt
The test builds are now requiring quilt refreshed patches instead of git
patches. Otherwise the build check will not even try to build something.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-08-20 13:14:35 +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 39da22d04a batman-adv: Always send iface index+name in genlmsg
The batman-adv netlink messages often contain the interface index and
interface name in the same message. This makes it easy for the receiver to
operate on the incoming data when it either needs to print something or
needs to operate on the interface index.

But one of the attributes was missing for:

* neighbor table dumps
* originator table dumps
* gateway list dumps
* query of hardif information
* query of vid information

The userspace therefore had to implement special workarounds using
SIOCGIFNAME or SIOCGIFINDEX depending on what was actually provided.
Providing both information simplifies the userspace code massively without
adding a lot of extra overhead in the kernel portion.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-18 18:51:26 +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 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 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 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 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 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 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 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 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 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 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 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 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
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 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
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
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 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
Marek Lindner 8a0a7fa06d batman-adv: 2015.0 bugfixes & stability updates
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2015-06-28 22:18:50 +08:00
Marek Lindner 54b696ef52 batman-adv: 2015.0 bugfixes & stability updates
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2015-06-21 19:04:04 +08: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 c00eb4f16a batman-adv: upgrade package to latest release 2014.1.0
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-05-13 05:29:35 +08:00
Marek Lindner b905f3f159 batman-adv: 2014.1.0 bugfixes & stability updates
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-03-31 21:00:08 +08:00
Marek Lindner 4602541204 batman-adv: upgrade package to latest release 2014.1.0
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-03-13 21:21:05 +08:00
Marek Lindner 2185559079 batman-adv: 2014.0.0 updated stability fixes
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-02-15 09:41:19 +08:00
Marek Lindner 46ea4de211 batman-adv: 2014.0.0 compat updates for older kernels
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-01-30 20:44:46 +08:00
Marek Lindner 4ef1f3eee1 batman-adv: 2014.0.0 updated stability fixes
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-01-29 13:00:04 +08:00
Marek Lindner c7e942386f batman-adv: fix batman-adv header overhead calculation
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-01-16 06:49:49 +08:00
Marek Lindner 1ee5b17e4f batman-adv: upgrade package to latest release 2014.0.0
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2014-01-14 03:16:56 +08:00
Marek Lindner ca078f89c2 batman-adv: upgrade package to latest release 2013.4.0
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2013-10-15 03:19:03 +08:00
Bastian Bittorf 1c0b315289 batman-adv: tweak the Makefile for dynamically patch 'main.h' via 'sed' by inserting '#undef CONFIG_MODULE_STRIPPED' - so the intelligent OpenWrt-optimizer will not destroy important module-metadata. remove the old patch which does the same, but needed rebasing everything main.h changes. compile and run-tested on ar71xx 2013-10-08 21:53:12 +02:00
Bastian Bittorf 31bf3fe9cf Revert "batman-adv: remove 'un-optimization' patch for openwrt"
This reverts commit a8e21bf882.
2013-09-30 00:09:08 +02:00