Commit Graph

82 Commits

Author SHA1 Message Date
Sven Eckelmann 305cce9234 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 21:00:56 +01:00
Sven Eckelmann 5cba01e37a 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:21:19 +01:00
Sven Eckelmann 020c99a39b 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:58:11 +02:00
Sven Eckelmann e100856a69 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:55 +02:00
Sven Eckelmann 0976335f1e 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:36 +02:00
Sven Eckelmann 24b2a9af0e 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:42:48 +01:00
Sven Eckelmann dca9b7e0ca batman-adv: Refresh patches
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-02-11 11:21:16 +01:00
Sven Eckelmann f622ffd9bc 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:56:57 +01:00
Sven Eckelmann 2c8de62f4a 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:12:30 +01:00
Sven Eckelmann 2ac8e7b42b 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:11:05 +02:00
Sven Eckelmann 79f1094690 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:55:07 +02:00
Sven Eckelmann ea1e2c9c4c batman-adv: Merge bugfixes 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
* 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:42:04 +02:00
Sven Eckelmann 9b777e6b13 batman-adv: Merge bugfixes from 2018.1
* Fix skbuff rcsum on packet reroute
* update data pointers after skb_cow()
* fix header size check in batadv_dbg_arp()
* Fix multicast packet loss with a single WANT_ALL_IPV4/6 flag
* fix multicast-via-unicast transmission with AP isolation
* fix packet loss for broadcasted DHCP packets to a server

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-04-25 20:29:31 +02:00
Sven Roederer 6317b51ba2 batman-adv: bump package-release
bump release as of merge 45d25d4dc4

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2018-03-26 19:28:23 +02:00
Sven Eckelmann 08935dfaa0 batman-adv: Merge bugfixes from 2018.0
* fix packet checksum in receive path
* invalidate checksum on fragment reassembly
* Ignore invalid batadv_iv_gw during netlink send
* Ignore invalid batadv_v_gw during netlink send
* Fix netlink dumping of BLA claims
* Fix netlink dumping of BLA backbones
* Fix internal interface indices types

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-02-27 18:23:20 +01:00
Sven Eckelmann 285c803c0a batman-adv: Merge bugfixes from 2017.4
* Fix lock for ogm cnt access in batadv_iv_ogm_calc_tq
* Fix check of retrieved orig_gw in batadv_v_gw_is_eligible
* Always initialize fragment header priority
* Avoid spurious warnings from bat_v neigh_cmp implementation
* fix TT sync flag inconsistencies
* Accept only filled wifi station info
* Use default throughput value on cfg80211 error
* do not add loop detection mac addresses to global tt
* Fix rx packet/bytes stats on local ARP reply
* handle race condition for claims between gateways
* fix memory leak when dropping packet from other gateway
* drop unicast packets from other backbone gw
* prevent duplication of ARP replies when DAT is used
* prevent multiple ARP replies sent by gateways if dat enabled
* Initialize gw sel_class via batadv_algo
* Keep fragments equally sized
* decrease maximum fragment size
* don't add loop detect macs to TT
* Treat NET_XMIT_CN as transmit successfully

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-12-26 13:09:35 +01:00
Sven Eckelmann 269baa28fe 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:33 +01:00
Sven Eckelmann b71f8bfccb 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 14:52:25 +01:00
Sven Eckelmann c14c231423 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 14:46:03 +01:00
Sven Eckelmann 8109d303bd 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 14:40:47 +01:00
Sven Eckelmann 67507b60a2 batman-adv: Add sha256 PKG_HASH for LEDE
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2017-01-30 14:40:47 +01:00
Marek Lindner 8d7ed3d04b batman-adv: compile batman v by default
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2017-01-30 14:40:47 +01:00
Matthias Schiffer a6c7413594 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 15:00:56 +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
lindnermarek 96d0019999 Merge pull request #221 from NeoRaider/batman-adv-version
batman-adv: move CONFIG_MODULE_STRIPPED hack to compat-hacks.h
2016-08-24 17:42:10 +08: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 50c28dd9c5 batman-adv: Exchange include order for uapi header files
The build of netlink.c in batman-adv 2016.3 will fail because the
definition of GENL_NAMESIZE and similar things are missing. This is is
caused by an incorrect order of backports and non-backports header files
mixed up with uapi and non-uapi header files. Parts of the header files
would not get included by include_next because it not anymore in the
remaining search paths.

Reported: Marek Lindner <marek.lindner@open-mesh.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-07-08 12:02:41 +02:00
Marek Lindner a4eae82c15 batman-adv: update package release to allow pkg upgrade
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-07-06 21:36:38 +08: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
Alexander Couzens 73da6b297e batman-adv: remove DEPENDS:=kmod-crypto-core
kmod-crypto-core was removed in openwrt/trunk svn 46820 and all
kconfig's are now built-in.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2016-06-05 03:51:02 +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 6d329737f9 batman-adv: revert partial cfg80211 kernel dependency
The entire batman-adv code relies on the kernel backports introduced
by the mac80211 package.

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-06 00:06:46 +08:00
Marek Lindner 006b1918e3 batman-adv: autoload cfg80211 kernel dependency
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-05 21:49:22 +08: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 0cdf3ba21c batman-adv: upgrade package to latest release 2016.1
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-04-21 15:48:27 +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
Sven Eckelmann 758d919870 batman-adv: Use the mac80211 compat layer
BATMAN_V (in the upcoming release) will use structures from the mac80211
package. These structures can be incompatible to the structures defined in
the header of the kernel. This can lead to weird problems like stack
overflows or memory corruptions.

To avoid this, the batman-adv has to be compiled against the mac80211
headers instead of the kernel headers. But this requires that the
compatibility headers of compat-wireless are used. So the batman-adv
compatibility layer has (mostly) be removed and instead the
compat-wireless/mac80211 compat layer has to be used.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-03-25 08:02:11 +01:00
Sven Eckelmann 53a921be2b batman-adv: upgrade package to latest release 2016.0
Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
2016-01-19 17:45:50 +01:00
Sven Eckelmann 0e7b291a54 batman-adv: Switch to HTTPS version of links
open-mesh.org and its subdomains can only be accessed via HTTPS. HTTP-only
requests are currently redirected automatically to HTTPS but references
to it should be only https.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-01-19 17:42:46 +01: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