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>
* 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>
* 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>
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>
* 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>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
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>
* 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>
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>
* 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>