Commit Graph

67 Commits

Author SHA1 Message Date
Sven Eckelmann 7a3e63fd45 batman-adv: Merge bugfixes from 2021.4
* fix error handling during interface initialization

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-11-19 17:20:13 +01:00
Sven Eckelmann c8734df677 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-11-19 17:17:04 +01:00
Sven Eckelmann 3c10076826 batman-adv: Merge bugfixes from 2021.2
* Avoid WARN_ON timing related checks

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-08-20 11:59:36 +02:00
Sven Eckelmann a995b62043 batman-adv: Merge bugfixes from 2021.1
* initialize "struct batadv_tvlv_tt_vlan_data"->reserved field

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-05-14 20:59:43 +02:00
Sven Eckelmann 596dc84b65 batman-adv: Merge bugfixes from 2021.0
* set .owner to THIS_MODULE
* Consider fragmentation for needed_headroom
* Reserve needed_*room for fragments
* Don't always reallocate the fragmentation skb head

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-01-28 21:44:03 +01:00
Sven Eckelmann 685968996f 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:40:40 +02:00
Sven Eckelmann 6dea537c07 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:36:05 +02:00
Sven Eckelmann 4c05fe97d9 batman-adv: Merge bugfixes from 2020.2
* Revert "disable ethtool link speed detection when auto negotiation off"

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-07-06 20:08:55 +02:00
Sven Eckelmann 5dd2f44a5b 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:06:04 +02:00
Sven Eckelmann 18a724e154 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:51:17 +01:00
Sven Eckelmann 242185e386 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:16:19 +01:00
Sven Eckelmann a2f2a13386 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:25:10 +02:00
Sven Eckelmann b04d24313d batman-adv: Readd Linux 4.19.x compat patches
The patches were accidentally deleted while testing the batman-adv 2019.3
bugfixes with various OpenWrt versions. But OpenWrt 19.07 will be released
with a mac80211 package which still uses the Linux 4.19 API. And thus the
OpenWrt 19.07 openwrt-routing branch still has to retain these compat
patches.

Fixes: a93e68447a ("alfred: Merge bugfixes from 2019.3")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-04 08:16:01 +02:00
Sven Eckelmann 9d559fdae9 batman-adv: Merge bugfixes from 2019.3
* Fix netlink dumping of all mcast_flags buckets

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-01 19:47:11 +02:00
Sven Eckelmann a93e68447a alfred: Merge bugfixes from 2019.3
* vis: Use rtnl to query list of hardifs of meshif
* vis: Retrieve hardif status via generic netlink

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-01 19:47:11 +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