batadv gw_mode client 0?
by Rob Cowart
Hi,
We've been using batman with alfred and MQTT on raspbian for about 3 years. We found it to be useful up to about 15 nodes, and then we'd saturate the wifi. Then we downgraded the driver and we can get slightly over 30. but something we found was all of our nodes were using gw_mode client 0, and we realized this isn't listed in the spec. Do you know what it does in that case, does it use the default of 20?
Thanks,
Rov
2 years, 6 months
INFO: rcu detected stall in netlink_sendmsg (4)
by syzbot
Hello,
syzbot found the following crash on:
HEAD commit: ae661dec Merge branch 'ifla_xdp_expected_fd'
git tree: bpf-next
console output: https://syzkaller.appspot.com/x/log.txt?x=12245647e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=b5acf5ac38a50651
dashboard link: https://syzkaller.appspot.com/bug?extid=0fb70e87d8e0ac278fe9
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
Unfortunately, I don't have any reproducer for this crash yet.
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+0fb70e87d8e0ac278fe9(a)syzkaller.appspotmail.com
rcu: INFO: rcu_preempt self-detected stall on CPU
rcu: 0-....: (1 GPs behind) idle=5c2/1/0x4000000000000002 softirq=376075/376076 fqs=5176
(t=10500 jiffies g=506061 q=176208)
NMI backtrace for cpu 0
CPU: 0 PID: 17281 Comm: syz-executor.5 Not tainted 5.6.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x188/0x20d lib/dump_stack.c:118
nmi_cpu_backtrace.cold+0x70/0xb1 lib/nmi_backtrace.c:101
nmi_trigger_cpumask_backtrace+0x231/0x27e lib/nmi_backtrace.c:62
trigger_single_cpu_backtrace include/linux/nmi.h:164 [inline]
rcu_dump_cpu_stacks+0x169/0x1b3 kernel/rcu/tree_stall.h:254
print_cpu_stall kernel/rcu/tree_stall.h:475 [inline]
check_cpu_stall kernel/rcu/tree_stall.h:549 [inline]
rcu_pending kernel/rcu/tree.c:3030 [inline]
rcu_sched_clock_irq.cold+0x518/0xc55 kernel/rcu/tree.c:2276
update_process_times+0x25/0x60 kernel/time/timer.c:1726
tick_sched_handle+0x9b/0x180 kernel/time/tick-sched.c:171
tick_sched_timer+0x4e/0x140 kernel/time/tick-sched.c:1314
__run_hrtimer kernel/time/hrtimer.c:1517 [inline]
__hrtimer_run_queues+0x32c/0xdd0 kernel/time/hrtimer.c:1579
hrtimer_interrupt+0x312/0x770 kernel/time/hrtimer.c:1641
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1119 [inline]
smp_apic_timer_interrupt+0x15b/0x600 arch/x86/kernel/apic/apic.c:1144
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
</IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:759 [inline]
RIP: 0010:lock_release+0x45f/0x7c0 kernel/locking/lockdep.c:4505
Code: 94 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 d0 02 00 00 48 83 3d 6d 1d 1b 08 00 0f 84 71 01 00 00 48 8b 3c 24 57 9d <0f> 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 48 01 c3 48 c7 03 00
RSP: 0018:ffffc90003d9ec30 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff12e7698 RBX: 1ffff920007b3d89 RCX: 1ffff110098769b9
RDX: dffffc0000000000 RSI: 1ffff110098769c5 RDI: 0000000000000282
RBP: ffff88804c3b4540 R08: 0000000000000004 R09: fffffbfff14cc269
R10: fffffbfff14cc268 R11: ffffffff8a661347 R12: bc95c6993a9665e0
R13: ffffffff87a36fb1 R14: ffff88804c3b4dd0 R15: 0000000000000003
__raw_spin_unlock_bh include/linux/spinlock_api_smp.h:174 [inline]
_raw_spin_unlock_bh+0x12/0x30 kernel/locking/spinlock.c:207
spin_unlock_bh include/linux/spinlock.h:383 [inline]
batadv_tt_local_purge_pending_clients+0x2a1/0x3b0 net/batman-adv/translation-table.c:3914
batadv_tt_local_resize_to_mtu+0x96/0x130 net/batman-adv/translation-table.c:4198
batadv_update_min_mtu net/batman-adv/hard-interface.c:626 [inline]
batadv_hardif_activate_interface.part.0.cold+0xc6/0x294 net/batman-adv/hard-interface.c:653
batadv_hardif_activate_interface net/batman-adv/hard-interface.c:800 [inline]
batadv_hardif_enable_interface+0x9f2/0xaa0 net/batman-adv/hard-interface.c:792
batadv_softif_slave_add+0x92/0x150 net/batman-adv/soft-interface.c:859
do_set_master net/core/rtnetlink.c:2470 [inline]
do_set_master+0x1d7/0x230 net/core/rtnetlink.c:2443
do_setlink+0xaa2/0x3680 net/core/rtnetlink.c:2605
__rtnl_newlink+0xad5/0x1590 net/core/rtnetlink.c:3266
rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3391
rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5454
netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2478
netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
sock_sendmsg_nosec net/socket.c:652 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:672
____sys_sendmsg+0x6b9/0x7d0 net/socket.c:2343
___sys_sendmsg+0x100/0x170 net/socket.c:2397
__sys_sendmsg+0xec/0x1b0 net/socket.c:2430
do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:294
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45c849
Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f043b72fc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f043b7306d4 RCX: 000000000045c849
RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003
RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000009f5 R14: 00000000004ccac9 R15: 000000000076bf0c
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller(a)googlegroups.com.
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
2 years, 6 months
[PATCH 0/4] pull request for net-next: batman-adv 2020-06-26
by Simon Wunderlich
Hi David,
here is a little feature/cleanup pull request of batman-adv to go into net-next.
Please pull or let me know of any problem!
Thank you,
Simon
The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407:
Linux 5.8-rc1 (2020-06-14 12:45:04 -0700)
are available in the Git repository at:
git://git.open-mesh.org/linux-merge.git tags/batadv-next-for-davem-20200630
for you to fetch changes up to 3bda14d09dc5789a895ab02b7dcfcec19b0a65b3:
batman-adv: Introduce a configurable per interface hop penalty (2020-06-26 10:37:11 +0200)
----------------------------------------------------------------
This feature/cleanup patchset includes the following patches:
- bump version strings, by Simon Wunderlich
- update mailing list URL, by Sven Eckelmann
- fix typos and grammar in documentation, by Sven Eckelmann
- introduce a configurable per interface hop penalty,
by Linus Luessing
----------------------------------------------------------------
Linus Lüssing (1):
batman-adv: Introduce a configurable per interface hop penalty
Simon Wunderlich (1):
batman-adv: Start new development cycle
Sven Eckelmann (2):
batman-adv: Switch mailing list subscription page
batman-adv: Fix typos and grammar in documentation
Documentation/networking/batman-adv.rst | 8 +++---
include/uapi/linux/batadv_packet.h | 50 ++++++++++++++++-----------------
include/uapi/linux/batman_adv.h | 7 +++--
net/batman-adv/bat_iv_ogm.c | 25 +++++++++--------
net/batman-adv/bat_v_elp.c | 10 +++----
net/batman-adv/bat_v_ogm.c | 27 +++++++++++-------
net/batman-adv/bridge_loop_avoidance.c | 6 ++--
net/batman-adv/distributed-arp-table.c | 2 +-
net/batman-adv/fragmentation.c | 6 ++--
net/batman-adv/hard-interface.c | 16 ++++++-----
net/batman-adv/log.h | 6 ++--
net/batman-adv/main.c | 2 +-
net/batman-adv/main.h | 8 +++---
net/batman-adv/multicast.c | 21 +++++++-------
net/batman-adv/netlink.c | 14 +++++++--
net/batman-adv/network-coding.c | 14 ++++-----
net/batman-adv/originator.c | 8 +++---
net/batman-adv/routing.c | 4 +--
net/batman-adv/send.c | 4 +--
net/batman-adv/soft-interface.c | 2 +-
net/batman-adv/tp_meter.c | 12 ++++----
net/batman-adv/translation-table.c | 10 +++----
net/batman-adv/tvlv.c | 4 +--
net/batman-adv/types.h | 18 ++++++++----
24 files changed, 156 insertions(+), 128 deletions(-)
2 years, 7 months
bits 10 to 15 in OGM packets
by Rahul Bothra
Hi,
I was going through the Internet Draft for B.A.T.M.A.N, and wanted to
confirm if the bits 10 to 15 in the OGM packet are supposed to be all
zeroes always?
Thanks
2 years, 7 months
Batman-adv Tweaking - bonding
by Mark Birss
Hi
With reference to the wiki topic at
https://www.open-mesh.org/projects/batman-adv/wiki/Tweaking
bonding
Available since: batman-adv 2010.1.0
When running the mesh over multiple WiFi interfaces per node
batman-adv is capable of optimizing the traffic flow to gain maximum
performance. Per default it operates in the "interface alternating"
mode (which is suitable for most situations) that switches the WiFi
interface with each hop to avoid store & forward. Alternatively,
batman-adv can be switched into "bonding mode" in which batman-adv is
using all interfaces at the same time to send & receive data. However,
this mode is only recommended in special one-hop cases. You can read
about our alternatebonding test results to see what suits you best.
The wiki shows that this is the only change required on both nodes to
use it in default interface alternating mode
batctl meshif bat0 bonding enabled
The wiki does not say how the throughput was measured after bonding was enabled
Will batctl tp be ok?
Regards
2 years, 7 months
Re: BATMAN-adv Debug options
by Sven Eckelmann
[please never contact me privately about batman-adv without a really good
reason. Cc at least the mailing list]
On Thursday, 25 June 2020 13:12:34 CEST Mark Birss wrote:
> "Is the lower layer working or did the lower layer break? Can be
> tested easily with multicast/broadcast and unicast pings on the lower
> device."
>
> How to do this ?
ping/ping6.
* unicast: just ping as normal the lower device (not bat0) IPv4 address or
(link local) IPv6 address
* multicast: just send from both sides an multicast ping. For example
ff02::1%wlan0 and check if the remote (not your own device) responds with a
unicast reply
> As for originator and neighbours this can also be checked by batctl or
> proc file system.
proc? If you have batman-adv entries in proc then you should definitely
upgrade. This was removed in 2010.
Should this have been a question about where to find the originators and
neighbors table? And you can see this via "batctl meshif bat0 originators"
and "batctl meshif bat0 neighbors". The "meshif bat0" has to replaced with
"-m bat0" on older batctl versions.
> Another question is there a breakdown of the meaning of the messages for
>
> $ cat /sys/kernel/debug/batman_adv/bat0/log
>
> The additional debug output is by default disabled. It can be enabled
> during run time. Following log_levels are defined:
No idea what you want here. The help text already says what each message type
is about. If you don't know what a specific feature is then please check the
wiki [1].
> and what is the Flags here
>
> root@LiMe-a376eb:~# batctl tl
> [B.A.T.M.A.N. adv 2020.1-openwrt-2, MainIF/MAC:
> dummy0/aa:84:86:a3:76:eb (bat0/72:8b:cf:a4:00:77 BATMAN_IV), TTVN: 4]
> Client VID Flags Last seen (CRC )
> 72:8b:cf:a4:00:77 -1 [.P....] 0.000 (0x1c349131)
> 50:3e:aa:06:6f:4d -1 [......] 0.280 (0x1c349131)
> 72:8b:cf:a4:00:77 0 [.P....] 0.000 (0x9243e316)
> cc:2d:e0:47:b3:56 -1 [......] 0.980 (0x1c349131)
> 72:8b:cf:a4:00:77 1 [.P....] 0.000 (0xdb7f9e31)
The flags here are
* 'R' BATADV_TT_CLIENT_ROAM
* 'N' BATADV_TT_CLIENT_NEW
* 'X' BATADV_TT_CLIENT_PENDING
* 'W' BATADV_TT_CLIENT_WIFI
* 'I' BATADV_TT_CLIENT_ISOLA
* 'P' BATADV_TT_CLIENT_NOPURGE
And they are documented in the wiki [2]
Kind regards,
Sven
[1] https://www.open-mesh.org/projects/batman-adv/wiki/Protocol_information
[2] https://www.open-mesh.org/projects/batman-adv/wiki/TT-Flags
2 years, 7 months
Re: KASAN: null-ptr-deref Write in blk_mq_map_swqueue
by syzbot
This bug is marked as fixed by commit:
blk-mq: Fix a recently introduced regression in
But I can't find it in any tested tree for more than 90 days.
Is it a correct commit? Please update it by replying:
#syz fix: exact-commit-title
Until then the bug is still considered open and
new crashes with the same signature are ignored.
2 years, 7 months
BATMAN-adv Debug options
by Mark Birss
Hi All
I just recently been using BATMAN-adv over ethernet
What other debug information are available to troubleshoot connection issues?
I have enabled for OpenWRT
echo "CONFIG_BATMAN_ADV_DEBUG=y" >> .config
echo "CONFIG_BATMAN_ADV_DEBUGFS=y" >> .config
echo "CONFIG_BATMAN_ADV_BLA=y" >> .config
echo "CONFIG_BATMAN_ADV_DAT=y" >> .config
echo "CONFIG_BATMAN_ADV_MCAST=y" >> .config
echo "CONFIG_BATMAN_ADV_NC=n" >> .config
echo "CONFIG_BATMAN_ADV_BATMAN_V=y" >> .config
echo "CONFIG_BATMAN_ADV_SYSFS=y" >> .config
echo "CONFIG_BATMAN_ADV_TRACING=y" >> .config
echo 255 > /sys/class/net/bat0/mesh/log_level
cat /sys/kernel/debug/batman_adv/bat0/log
since i want to understand also why on wifi mesh seems to crash for me ath10k
Regards
2 years, 7 months
Re: batadv gw_mode client 0?
by Sven Eckelmann
On Wednesday, 24 June 2020 21:23:09 CEST Rob Cowart wrote:
[...]
> I have another question regarding batman, is there a way to connect to the nodes using only batman?
batman-adv doesn't have any special TCP like protocol or remote shell access
protocol. But you can either try to find the neighbors using link local IPv6
and directly use this to connect to the remote:
ping ff02::1%bat0
# or
ping ff02::1%wlan0
And if you see a couple of dups like this:
$ ping ff02::1%wlan0
PING ff02::1%wlan0 (ff02::1%22): 56 data bytes
64 bytes from fe80::84ec:1cff:fea1:5629: seq=0 ttl=64 time=1.211 ms
64 bytes from fe80::6c39:baff:fe1c:6d11: seq=0 ttl=64 time=7.107 ms (DUP!)
then you can just ssh to this node over IPv6 link local like this:
ssh fe80::6c39:baff:fe1c:6d11%wlan0
Just make sure that you are actually add the interface name + "%" separator.
> We have a situation where we've deployed batman V / alfred mesh networks (in several factories in Mexico, US and China) and then found dnsmasq is not up to the task of keeping our ips straight (with 20-30 nodes per mesh even) over months and years. So we're trying to remotely change them all to static, but midway through the mesh (or whatever part of the mesh lets us ssh to the nodes) breaks down. The nodes still show on batctl
> pi@raspberrypi:~ $ sudo batctl n
> [B.A.T.M.A.N. adv 2018.4-23-g89ba2134-dirty, MainIF/MAC: wlan0/b8:27:eb:fb:4e:58 (bat0/d6:86:8d:7d:39:4d BATMAN_V)]
> IF Neighbor last-seen
> b8:27:eb:4e:73:6d 25.330s ( 1.0) [ wlan0]
> b8:27:eb:ff:0e:b6 23.320s ( 1.0) [ wlan0]
> b8:27:eb:08:13:37 18.850s ( 1.0) [ wlan0]
> b8:27:eb:aa:1e:6d 37.010s ( 1.0) [ wlan0]
> b8:27:eb:35:c6:77 63.590s ( 1.0) [ wlan0]
> b8:27:eb:e9:34:41 18.280s ( 1.0) [ wlan0]
> b8:27:eb:84:ca:90 30.560s ( 1.0) [ wlan0]
> b8:27:eb:1e:eb:cd 27.410s ( 1.0) [ wlan0]
> b8:27:eb:cb:80:34 23.100s ( 1.0) [ wlan0]
Not sure what the ELP interval is here but the last seen is extremely high. I
would guess that the lower link actually broke down and the neighbor entries
just didn't time out yet.
> Also I was trying to figure out how to snoop what alfred is doing, since our MQTT goes over alfred over batman and that's what's not working...
There was a wireshark dissector written by some person [1]. But it might need
some updating to get it working with newer wireshark versions.
> So if you started from scratch how would you architect, is there a way to use batman for everything?
But the combination mqtt with alfred sounds weird. Alfred just stores some
very simple "facts" and distributes it slowly through the network. But MQTT is
a messaging protocol and is often used for realtime message transport. So in
most situations you would skip alfred and just use mqtt over whatever network
you want. No special batman-adv stuff needed.
Kind regards,
Sven
[1] https://github.com/basros/alfred-dissector
2 years, 7 months
batman-adv: Drop support for Linux < 4.4
by Sven Eckelmann
The Linux Kernel 3.16 reached its end of life [1] after 6 years. Instead it
is recommended to use at least kernel 4.4. It is also already over 4 years
old but still maintained by the stable kernel team. All older kernels
(v3.16 - v4.3) should therefore be dropped to reduce the support overhead.
[1] https://lkml.kernel.org/r/lsq.1591898928.276150302@decadent.org.uk
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile b/Makefile
index b518db1fbfee64bd2771402a13dd4e09219665ec..afdbc03c368e5ea267c325090dc2a14f5e6a95f0 100644
--- a/Makefile
+++ b/Makefile
@@ -49,8 +49,6 @@ ifneq ($(REVISION),)
NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
endif
-include $(PWD)/compat-sources/Makefile
-
obj-y += net/batman-adv/
export batman-adv-y
diff --git a/README.external.rst b/README.external.rst
index d8465aa836529f7a6bb277a720c0f58c64b778c3..b4d07e64fbeca95c58b4d436c8d08e0767ceba72 100644
--- a/README.external.rst
+++ b/README.external.rst
@@ -12,7 +12,7 @@ and as external module. The external module allows to get
new features without upgrading to a newer kernel version
and to get batman-adv specific bugfixes for kernels that are
not supported anymore. It compiles against and should work
-with Linux 3.16 - 5.7. Supporting older versions is not
+with Linux 4.4 - 5.7. Supporting older versions is not
planned, but it's probably easy to backport it. If you work on a
backport, feel free to contact us. :-)
diff --git a/compat-include/linux/average.h b/compat-include/linux/average.h
index 046e9cb5161ae1abefb0da933656027a361e352a..347fdeae5af0058c8ff45ccdf4871c367310b44a 100644
--- a/compat-include/linux/average.h
+++ b/compat-include/linux/average.h
@@ -10,16 +10,13 @@
#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_AVERAGE_H
#define _NET_BATMAN_ADV_COMPAT_LINUX_AVERAGE_H
-#include <linux/version.h>
#include_next <linux/average.h>
#include <linux/bug.h>
#include <linux/compiler.h>
#include <linux/log2.h>
-#if LINUX_VERSION_IS_GEQ(4, 3, 0)
#undef DECLARE_EWMA
-#endif /* LINUX_VERSION_IS_LESS(4, 3, 0) */
/*
* Exponentially weighted moving average (EWMA)
diff --git a/compat-include/linux/compiler.h b/compat-include/linux/compiler.h
index 89ed29299ba3cc4e78270d408a37a3c9f9fefa8e..43e12a788ad17a4537c35797b267c95edfd734f1 100644
--- a/compat-include/linux/compiler.h
+++ b/compat-include/linux/compiler.h
@@ -13,21 +13,6 @@
#include <linux/version.h>
#include_next <linux/compiler.h>
-#if LINUX_VERSION_IS_LESS(3, 19, 0)
-
-#ifndef READ_ONCE
-#define READ_ONCE(x) ACCESS_ONCE(x)
-#endif
-
-#ifndef WRITE_ONCE
-#define WRITE_ONCE(x, val) ({ \
- ACCESS_ONCE(x) = (val); \
-})
-#endif
-
-#endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
-
-
#if LINUX_VERSION_IS_LESS(5, 4, 0)
#ifndef fallthrough
diff --git a/compat-include/linux/if_bridge.h b/compat-include/linux/if_bridge.h
deleted file mode 100644
index 8dfcef19c0e00f005e109e8f34b6e403536fd2a1..0000000000000000000000000000000000000000
--- a/compat-include/linux/if_bridge.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_IF_BRIDGE_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_IF_BRIDGE_H_
-
-#include <linux/version.h>
-#include_next <linux/if_bridge.h>
-
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-struct br_ip {
- union {
- __be32 ip4;
-#if IS_ENABLED(CONFIG_IPV6)
- struct in6_addr ip6;
-#endif
- } u;
- __be16 proto;
- __u16 vid;
-};
-
-struct br_ip_list {
- struct list_head list;
- struct br_ip addr;
-};
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#if LINUX_VERSION_IS_LESS(3, 16, 0) || \
- LINUX_VERSION_CODE == KERNEL_VERSION(3, 16, 0) && \
- (!IS_ENABLED(CONFIG_BRIDGE) || \
- !IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING))
-
-#define br_multicast_list_adjacent(dev, br_ip_list) \
- batadv_br_multicast_list_adjacent(dev, br_ip_list)
-
-#define br_multicast_has_querier_adjacent(dev, proto) \
- batadv_br_multicast_has_querier_adjacent(dev, proto)
-
-static inline int
-batadv_br_multicast_list_adjacent(struct net_device *dev,
- struct list_head *br_ip_list)
-{
- return 0;
-}
-
-static inline bool
-batadv_br_multicast_has_querier_adjacent(struct net_device *dev, int proto)
-{
- return false;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) ||
- * == KERNEL_VERSION(3, 16, 0) &&
- * (!IS_ENABLED(CONFIG_BRIDGE) ||
- * !IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING)) */
-
-#if LINUX_VERSION_IS_LESS(3, 17, 0)
-
-static inline bool br_multicast_has_querier_anywhere(struct net_device *dev,
- int proto)
-{
- pr_warn_once("Old kernel detected (< 3.17) - multicast optimizations disabled\n");
-
- return false;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(3, 17, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_IF_BRIDGE_H_ */
diff --git a/compat-include/linux/igmp.h b/compat-include/linux/igmp.h
index 9875d6d4e7392c23faf8fec73d059bbc87c57e22..cea5bfe9f5f03617608672bf6eceec4bf6a04b83 100644
--- a/compat-include/linux/igmp.h
+++ b/compat-include/linux/igmp.h
@@ -13,11 +13,7 @@
#include <linux/version.h>
#include_next <linux/igmp.h>
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-int ip_mc_check_igmp(struct sk_buff *skb);
-
-#elif LINUX_VERSION_IS_LESS(5, 1, 0)
+#if LINUX_VERSION_IS_LESS(5, 1, 0)
static inline int batadv_ip_mc_check_igmp(struct sk_buff *skb)
{
@@ -27,6 +23,6 @@ static inline int batadv_ip_mc_check_igmp(struct sk_buff *skb)
#define ip_mc_check_igmp(skb) \
batadv_ip_mc_check_igmp(skb)
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
+#endif /* LINUX_VERSION_IS_LESS(5, 1, 0) */
#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_IGMP_H_ */
diff --git a/compat-include/linux/list.h b/compat-include/linux/list.h
deleted file mode 100644
index 1bd85d0d73d99700fd491c7f5830cfad6f976cbe..0000000000000000000000000000000000000000
--- a/compat-include/linux/list.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_LIST_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_LIST_H_
-
-#include <linux/version.h>
-#include_next <linux/list.h>
-
-#if LINUX_VERSION_IS_LESS(3, 17, 0)
-
-#define hlist_add_behind(n, prev) hlist_add_after(prev, n)
-
-#endif /* LINUX_VERSION_IS_LESS(3, 17, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 3, 0)
-
-static inline bool hlist_fake(struct hlist_node *h)
-{
- return h->pprev == &h->next;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(4, 3, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_LIST_H_ */
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h
index ae7fb906833e04dcb93952c7e73f37b3584a2f54..5dd273412d60cd0b77086ee6d810784626407ec6 100644
--- a/compat-include/linux/netdevice.h
+++ b/compat-include/linux/netdevice.h
@@ -13,21 +13,6 @@
#include <linux/version.h>
#include_next <linux/netdevice.h>
-#if LINUX_VERSION_IS_LESS(3, 17, 0)
-
-/* alloc_netdev() was defined differently before 2.6.38 */
-#undef alloc_netdev
-#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
- alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
-
-#endif /* LINUX_VERSION_IS_LESS(3, 17, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 1, 0)
-
-#define dev_get_iflink(_net_dev) ((_net_dev)->iflink)
-
-#endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
-
#if LINUX_VERSION_IS_LESS(4, 5, 0)
#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) \
diff --git a/compat-include/linux/nl80211.h b/compat-include/linux/nl80211.h
deleted file mode 100644
index bea92d1b73768ae2236bb67a0d554e341ad722ac..0000000000000000000000000000000000000000
--- a/compat-include/linux/nl80211.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_NL80211_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_NL80211_H_
-
-#include <linux/version.h>
-#include_next <linux/nl80211.h>
-
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-/* Linux 3.15 misses the uapi include.... */
-#include <uapi/linux/nl80211.h>
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_NL80211_H_ */
diff --git a/compat-include/linux/seq_file.h b/compat-include/linux/seq_file.h
deleted file mode 100644
index 74854f563c7025628ef8df05258a9fbb93137c11..0000000000000000000000000000000000000000
--- a/compat-include/linux/seq_file.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_SEQ_FILE_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_SEQ_FILE_H_
-
-#include <linux/version.h>
-#include_next <linux/seq_file.h>
-
-#if LINUX_VERSION_IS_LESS(3, 19, 0)
-
-static inline bool seq_has_overflowed(struct seq_file *m)
-{
- return m->count == m->size;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_SEQ_FILE_H_ */
diff --git a/compat-include/linux/skbuff.h b/compat-include/linux/skbuff.h
index e92f3422a45c6c7bc0a2ffc4a5661bc25b160fc7..0d3631d2cf426692bbd20e0be039453acaf24c98 100644
--- a/compat-include/linux/skbuff.h
+++ b/compat-include/linux/skbuff.h
@@ -13,26 +13,6 @@
#include <linux/version.h>
#include_next <linux/skbuff.h>
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-#define pskb_copy_for_clone pskb_copy
-
-__sum16 skb_checksum_simple_validate(struct sk_buff *skb);
-
-__sum16
-skb_checksum_validate(struct sk_buff *skb, int proto,
- __wsum (*compute_pseudo)(struct sk_buff *skb, int proto));
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb,
- unsigned int transport_len,
- __sum16(*skb_chkf)(struct sk_buff *skb));
-
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
-
#if LINUX_VERSION_IS_LESS(4, 5, 0)
static inline void batadv_skb_postpush_rcsum(struct sk_buff *skb,
diff --git a/compat-include/linux/string.h b/compat-include/linux/string.h
deleted file mode 100644
index 7197803100f600dfe2dd705f597a65dd73a129f2..0000000000000000000000000000000000000000
--- a/compat-include/linux/string.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2015 Chris Metcalf <cmetcalf(a)ezchip.com>
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_STRING_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_STRING_H_
-
-#include <linux/version.h>
-#include_next <linux/string.h>
-#include <asm-generic/errno-base.h>
-
-#if LINUX_VERSION_IS_LESS(4, 3, 0)
-
-#ifndef __HAVE_ARCH_STRSCPY
-
-static inline ssize_t batadv_strscpy(char *dest, const char *src, size_t count)
-{
- long res = 0;
-
- if (count == 0)
- return -E2BIG;
-
- while (count) {
- char c;
-
- c = src[res];
- dest[res] = c;
- if (!c)
- return res;
- res++;
- count--;
- }
-
- /* Hit buffer length without finding a NUL; force NUL-termination. */
- if (res)
- dest[res-1] = '\0';
-
- return -E2BIG;
-}
-
-#define strscpy(_dest, _src, _count) \
- batadv_strscpy((_dest), (_src), (_count))
-
-#endif
-
-#endif /* LINUX_VERSION_IS_LESS(4, 3, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_STRING_H_ */
diff --git a/compat-include/net/addrconf.h b/compat-include/net/addrconf.h
index 5430811a25e8007d2c985e6252f99fcba4ab6791..8914a66b0f30d813dfd716c94e147a185a667e7c 100644
--- a/compat-include/net/addrconf.h
+++ b/compat-include/net/addrconf.h
@@ -13,11 +13,7 @@
#include <linux/version.h>
#include_next <net/addrconf.h>
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-int ipv6_mc_check_mld(struct sk_buff *skb);
-
-#elif LINUX_VERSION_IS_LESS(5, 1, 0)
+#if LINUX_VERSION_IS_LESS(5, 1, 0)
static inline int batadv_ipv6_mc_check_mld(struct sk_buff *skb)
{
@@ -27,6 +23,6 @@ static inline int batadv_ipv6_mc_check_mld(struct sk_buff *skb)
#define ipv6_mc_check_mld(skb) \
batadv_ipv6_mc_check_mld(skb)
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
+#endif /* LINUX_VERSION_IS_LESS(5, 1, 0) */
#endif /* _NET_BATMAN_ADV_COMPAT_NET_ADDRCONF_H_ */
diff --git a/compat-include/net/cfg80211.h b/compat-include/net/cfg80211.h
index 241f44e060f977231f6d3e7ab07b407264dbb26c..288c1be132f64f13b7888cd72923e7813afecbf1 100644
--- a/compat-include/net/cfg80211.h
+++ b/compat-include/net/cfg80211.h
@@ -13,25 +13,6 @@
#include <linux/version.h>
#include_next <net/cfg80211.h>
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-static inline int cfg80211_get_station(struct net_device *dev,
- const u8 *mac_addr,
- struct station_info *sinfo)
-{
- pr_warn_once("cfg80211 based throughput metric is only supported with Linux 3.16+\n");
- return -ENOENT;
-}
-
-/* The following define substitutes the expected_throughput field with a random
- * one existing in the station_info struct. It can be random because due to the
- * function above it will never be used. Only needed to make the code compile
- */
-#define expected_throughput filled
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-
#if LINUX_VERSION_IS_LESS(4, 8, 0)
#if !IS_ENABLED(CONFIG_CFG80211) && \
diff --git a/compat-include/net/ip6_checksum.h b/compat-include/net/ip6_checksum.h
deleted file mode 100644
index 8997cbf9e6db9cbb3ad4b5d6f71eb0956c29f517..0000000000000000000000000000000000000000
--- a/compat-include/net/ip6_checksum.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_
-#define _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_
-
-#include <linux/version.h>
-#include_next <net/ip6_checksum.h>
-
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-static inline __wsum ip6_compute_pseudo(struct sk_buff *skb, int proto)
-{
- return ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
- &ipv6_hdr(skb)->daddr,
- skb->len, proto, 0));
-}
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_ */
diff --git a/compat-include/net/netlink.h b/compat-include/net/netlink.h
deleted file mode 100644
index c7419e155daf0a31576b67e07aca28cc4fc1ad88..0000000000000000000000000000000000000000
--- a/compat-include/net/netlink.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_NET_NETLINK_H_
-#define _NET_BATMAN_ADV_COMPAT_NET_NETLINK_H_
-
-#include <linux/version.h>
-#include_next <net/netlink.h>
-
-#if LINUX_VERSION_IS_LESS(4, 1, 0)
-
-static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype,
- __be32 addr)
-{
- __be32 tmp = addr;
-
- return nla_put_be32(skb, attrtype, tmp);
-}
-
-#endif /* LINUX_VERSION_IS_LESS(4, 1, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_NET_NETLINK_H_ */
diff --git a/compat-include/uapi/linux/nl80211.h b/compat-include/uapi/linux/nl80211.h
deleted file mode 100644
index dff0dd5c6f2f43d46162d46a041f91cb3696c178..0000000000000000000000000000000000000000
--- a/compat-include/uapi/linux/nl80211.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_
-#define _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_
-
-#include <linux/version.h>
-#include_next <uapi/linux/nl80211.h>
-
-#if LINUX_VERSION_IS_LESS(4, 0, 0)
-
-/* for batadv_v_elp_get_throughput which would have used
- * STATION_INFO_EXPECTED_THROUGHPUT in Linux 4.0.0
- */
-#define NL80211_STA_INFO_EXPECTED_THROUGHPUT 28
-
-#endif /* LINUX_VERSION_IS_LESS(4, 0, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_ */
diff --git a/compat-sources/Makefile b/compat-sources/Makefile
deleted file mode 100644
index fd2fce8f4f3d46b197f780d519e333cd3b049556..0000000000000000000000000000000000000000
--- a/compat-sources/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
-#
-# Marek Lindner, Simon Wunderlich
-
-batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/core/skbuff.o
-batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/ipv4/igmp.o
-batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/ipv6/mcast_snoop.o
diff --git a/compat-sources/net/core/skbuff.c b/compat-sources/net/core/skbuff.c
deleted file mode 100644
index fd2771ae9db3dc72d420a1730633c618a631f99b..0000000000000000000000000000000000000000
--- a/compat-sources/net/core/skbuff.c
+++ /dev/null
@@ -1,195 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Routines having to do with the 'struct sk_buff' memory handlers.
- *
- * Authors: Alan Cox <alan(a)lxorguk.ukuu.org.uk>
- * Florian La Roche <rzsfl(a)rz.uni-sb.de>
- *
- * Fixes:
- * Alan Cox : Fixed the worst of the load
- * balancer bugs.
- * Dave Platt : Interrupt stacking fix.
- * Richard Kooijman : Timestamp fixes.
- * Alan Cox : Changed buffer format.
- * Alan Cox : destructor hook for AF_UNIX etc.
- * Linus Torvalds : Better skb_clone.
- * Alan Cox : Added skb_copy.
- * Alan Cox : Added all the changed routines Linus
- * only put in the headers
- * Ray VanTassle : Fixed --skb->lock in free
- * Alan Cox : skb_copy copy arp field
- * Andi Kleen : slabified it.
- * Robert Olsson : Removed skb_head_pool
- *
- * NOTE:
- * The __skb_ routines should be called with interrupts
- * disabled, or you better be *real* sure that the operation is atomic
- * with respect to whatever list is being frobbed (e.g. via lock_sock()
- * or via disabling bottom half handlers, etc).
- */
-
-#include <linux/in6.h>
-#include <linux/ipv6.h>
-#include <linux/skbuff.h>
-#include <linux/types.h>
-#include <net/checksum.h>
-#include <net/ip6_checksum.h>
-
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-/* Compare with:
- * "bridge: multicast: call skb_checksum_{simple_, }validate"
- */
-__sum16 skb_checksum_simple_validate(struct sk_buff *skb)
-{
- switch (skb->ip_summed) {
- case CHECKSUM_COMPLETE:
- if (!csum_fold(skb->csum))
- break;
- fallthrough;
- case CHECKSUM_NONE:
- skb->csum = 0;
- return skb_checksum_complete(skb);
- }
-
- return 0;
-}
-
-/* Watch out: Not as generic as upstream
- * - redefines this method to only fit with ICMPV6
- *
- * Compare with:
- * "bridge: multicast: call skb_checksum_{simple_, }validate"
- */
-__sum16
-skb_checksum_validate(struct sk_buff *skb, int proto,
- __wsum (*compute_pseudo)(struct sk_buff *skb, int proto))
-{
- const struct ipv6hdr *ip6h = ipv6_hdr(skb);
-
- switch (skb->ip_summed) {
- case CHECKSUM_COMPLETE:
- if (!csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, skb->len,
- IPPROTO_ICMPV6, skb->csum))
- break;
- fallthrough;
- case CHECKSUM_NONE:
- skb->csum = ~csum_unfold(csum_ipv6_magic(&ip6h->saddr,
- &ip6h->daddr,
- skb->len,
- IPPROTO_ICMPV6, 0));
- return __skb_checksum_complete(skb);
- }
-
- return 0;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-/**
- * skb_push_rcsum - push skb and update receive checksum
- * @skb: buffer to update
- * @len: length of data pulled
- *
- * This function performs an skb_push on the packet and updates
- * the CHECKSUM_COMPLETE checksum. It should be used on
- * receive path processing instead of skb_push unless you know
- * that the checksum difference is zero (e.g., a valid IP header)
- * or you are setting ip_summed to CHECKSUM_NONE.
- */
-static unsigned char *skb_push_rcsum(struct sk_buff *skb, unsigned len)
-{
- skb_push(skb, len);
- skb_postpush_rcsum(skb, skb->data, len);
- return skb->data;
-}
-
-/**
- * skb_checksum_maybe_trim - maybe trims the given skb
- * @skb: the skb to check
- * @transport_len: the data length beyond the network header
- *
- * Checks whether the given skb has data beyond the given transport length.
- * If so, returns a cloned skb trimmed to this transport length.
- * Otherwise returns the provided skb. Returns NULL in error cases
- * (e.g. transport_len exceeds skb length or out-of-memory).
- *
- * Caller needs to set the skb transport header and release the returned skb.
- * Provided skb is consumed.
- */
-static struct sk_buff *skb_checksum_maybe_trim(struct sk_buff *skb,
- unsigned int transport_len)
-{
- struct sk_buff *skb_chk;
- unsigned int len = skb_transport_offset(skb) + transport_len;
- int ret;
-
- if (skb->len < len) {
- kfree_skb(skb);
- return NULL;
- } else if (skb->len == len) {
- return skb;
- }
-
- skb_chk = skb_clone(skb, GFP_ATOMIC);
- kfree_skb(skb);
-
- if (!skb_chk)
- return NULL;
-
- ret = pskb_trim_rcsum(skb_chk, len);
- if (ret) {
- kfree_skb(skb_chk);
- return NULL;
- }
-
- return skb_chk;
-}
-
-/**
- * skb_checksum_trimmed - validate checksum of an skb
- * @skb: the skb to check
- * @transport_len: the data length beyond the network header
- * @skb_chkf: checksum function to use
- *
- * Applies the given checksum function skb_chkf to the provided skb.
- * Returns a checked and maybe trimmed skb. Returns NULL on error.
- *
- * If the skb has data beyond the given transport length, then a
- * trimmed & cloned skb is checked and returned.
- *
- * Caller needs to set the skb transport header and release the returned skb.
- * Provided skb is consumed.
- */
-struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb,
- unsigned int transport_len,
- __sum16(*skb_chkf)(struct sk_buff *skb))
-{
- struct sk_buff *skb_chk;
- unsigned int offset = skb_transport_offset(skb);
- __sum16 ret;
-
- skb_chk = skb_checksum_maybe_trim(skb, transport_len);
- if (!skb_chk)
- return NULL;
-
- if (!pskb_may_pull(skb_chk, offset)) {
- kfree_skb(skb_chk);
- return NULL;
- }
-
- skb_pull_rcsum(skb_chk, offset);
- ret = skb_chkf(skb_chk);
- skb_push_rcsum(skb_chk, offset);
-
- if (ret) {
- kfree_skb(skb_chk);
- return NULL;
- }
-
- return skb_chk;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
diff --git a/compat-sources/net/ipv4/igmp.c b/compat-sources/net/ipv4/igmp.c
deleted file mode 100644
index 6c6396764b977a057ab82ba4a327cf19a2fc8744..0000000000000000000000000000000000000000
--- a/compat-sources/net/ipv4/igmp.c
+++ /dev/null
@@ -1,223 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Linux NET3: Internet Group Management Protocol [IGMP]
- *
- * This code implements the IGMP protocol as defined in RFC1112. There has
- * been a further revision of this protocol since which is now supported.
- *
- * If you have trouble with this module be careful what gcc you have used,
- * the older version didn't come out right using gcc 2.5.8, the newer one
- * seems to fall out with gcc 2.6.2.
- *
- * Authors:
- * Alan Cox <alan(a)lxorguk.ukuu.org.uk>
- *
- * Fixes:
- *
- * Alan Cox : Added lots of __inline__ to optimise
- * the memory usage of all the tiny little
- * functions.
- * Alan Cox : Dumped the header building experiment.
- * Alan Cox : Minor tweaks ready for multicast routing
- * and extended IGMP protocol.
- * Alan Cox : Removed a load of inline directives. Gcc 2.5.8
- * writes utterly bogus code otherwise (sigh)
- * fixed IGMP loopback to behave in the manner
- * desired by mrouted, fixed the fact it has been
- * broken since 1.3.6 and cleaned up a few minor
- * points.
- *
- * Chih-Jen Chang : Tried to revise IGMP to Version 2
- * Tsu-Sheng Tsao E-mail: chihjenc(a)scf.usc.edu and tsusheng(a)scf.usc.edu
- * The enhancements are mainly based on Steve Deering's
- * ipmulti-3.5 source code.
- * Chih-Jen Chang : Added the igmp_get_mrouter_info and
- * Tsu-Sheng Tsao igmp_set_mrouter_info to keep track of
- * the mrouted version on that device.
- * Chih-Jen Chang : Added the max_resp_time parameter to
- * Tsu-Sheng Tsao igmp_heard_query(). Using this parameter
- * to identify the multicast router version
- * and do what the IGMP version 2 specified.
- * Chih-Jen Chang : Added a timer to revert to IGMP V2 router
- * Tsu-Sheng Tsao if the specified time expired.
- * Alan Cox : Stop IGMP from 0.0.0.0 being accepted.
- * Alan Cox : Use GFP_ATOMIC in the right places.
- * Christian Daudt : igmp timer wasn't set for local group
- * memberships but was being deleted,
- * which caused a "del_timer() called
- * from %p with timer not initialized\n"
- * message (960131).
- * Christian Daudt : removed del_timer from
- * igmp_timer_expire function (960205).
- * Christian Daudt : igmp_heard_report now only calls
- * igmp_timer_expire if tm->running is
- * true (960216).
- * Malcolm Beattie : ttl comparison wrong in igmp_rcv made
- * igmp_heard_query never trigger. Expiry
- * miscalculation fixed in igmp_heard_query
- * and random() made to return unsigned to
- * prevent negative expiry times.
- * Alexey Kuznetsov: Wrong group leaving behaviour, backport
- * fix from pending 2.1.x patches.
- * Alan Cox: Forget to enable FDDI support earlier.
- * Alexey Kuznetsov: Fixed leaving groups on device down.
- * Alexey Kuznetsov: Accordance to igmp-v2-06 draft.
- * David L Stevens: IGMPv3 support, with help from
- * Vinay Kulkarni
- */
-
-#include <linux/igmp.h>
-#include <linux/ip.h>
-#include <linux/skbuff.h>
-#include <net/ip.h>
-
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-static int ip_mc_check_iphdr(struct sk_buff *skb)
-{
- const struct iphdr *iph;
- unsigned int len;
- unsigned int offset = skb_network_offset(skb) + sizeof(*iph);
-
- if (!pskb_may_pull(skb, offset))
- return -EINVAL;
-
- iph = ip_hdr(skb);
-
- if (iph->version != 4 || ip_hdrlen(skb) < sizeof(*iph))
- return -EINVAL;
-
- offset += ip_hdrlen(skb) - sizeof(*iph);
-
- if (!pskb_may_pull(skb, offset))
- return -EINVAL;
-
- iph = ip_hdr(skb);
-
- if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
- return -EINVAL;
-
- len = skb_network_offset(skb) + ntohs(iph->tot_len);
- if (skb->len < len || len < offset)
- return -EINVAL;
-
- skb_set_transport_header(skb, offset);
-
- return 0;
-}
-
-static int ip_mc_check_igmp_reportv3(struct sk_buff *skb)
-{
- unsigned int len = skb_transport_offset(skb);
-
- len += sizeof(struct igmpv3_report);
-
- return pskb_may_pull(skb, len) ? 0 : -EINVAL;
-}
-
-static int ip_mc_check_igmp_query(struct sk_buff *skb)
-{
- unsigned int len = skb_transport_offset(skb);
-
- len += sizeof(struct igmphdr);
- if (skb->len < len)
- return -EINVAL;
-
- /* IGMPv{1,2}? */
- if (skb->len != len) {
- /* or IGMPv3? */
- len += sizeof(struct igmpv3_query) - sizeof(struct igmphdr);
- if (skb->len < len || !pskb_may_pull(skb, len))
- return -EINVAL;
- }
-
- /* RFC2236+RFC3376 (IGMPv2+IGMPv3) require the multicast link layer
- * all-systems destination addresses (224.0.0.1) for general queries
- */
- if (!igmp_hdr(skb)->group &&
- ip_hdr(skb)->daddr != htonl(INADDR_ALLHOSTS_GROUP))
- return -EINVAL;
-
- return 0;
-}
-
-static int ip_mc_check_igmp_msg(struct sk_buff *skb)
-{
- switch (igmp_hdr(skb)->type) {
- case IGMP_HOST_LEAVE_MESSAGE:
- case IGMP_HOST_MEMBERSHIP_REPORT:
- case IGMPV2_HOST_MEMBERSHIP_REPORT:
- /* fall through */
- return 0;
- case IGMPV3_HOST_MEMBERSHIP_REPORT:
- return ip_mc_check_igmp_reportv3(skb);
- case IGMP_HOST_MEMBERSHIP_QUERY:
- return ip_mc_check_igmp_query(skb);
- default:
- return -ENOMSG;
- }
-}
-
-static inline __sum16 ip_mc_validate_checksum(struct sk_buff *skb)
-{
- return skb_checksum_simple_validate(skb);
-}
-
-static int __ip_mc_check_igmp(struct sk_buff *skb)
-
-{
- struct sk_buff *skb_chk;
- unsigned int transport_len;
- unsigned int len = skb_transport_offset(skb) + sizeof(struct igmphdr);
- int ret;
-
- transport_len = ntohs(ip_hdr(skb)->tot_len) - ip_hdrlen(skb);
-
- skb_get(skb);
- skb_chk = skb_checksum_trimmed(skb, transport_len,
- ip_mc_validate_checksum);
- if (!skb_chk)
- return -EINVAL;
-
- if (!pskb_may_pull(skb_chk, len)) {
- kfree_skb(skb_chk);
- return -EINVAL;
- }
-
- ret = ip_mc_check_igmp_msg(skb_chk);
- if (ret) {
- kfree_skb(skb_chk);
- return ret;
- }
-
- kfree_skb(skb_chk);
-
- return 0;
-}
-
-/**
- * ip_mc_check_igmp - checks whether this is a sane IGMP packet
- * @skb: the skb to validate
- *
- * Checks whether an IPv4 packet is a valid IGMP packet. If so sets
- * skb network and transport headers accordingly and returns zero.
- *
- * -EINVAL: A broken packet was detected, i.e. it violates some internet
- * standard
- * -ENOMSG: IP header validation succeeded but it is not an IGMP packet.
- * -ENOMEM: A memory allocation failure happened.
- */
-int ip_mc_check_igmp(struct sk_buff *skb)
-{
- int ret = ip_mc_check_iphdr(skb);
-
- if (ret < 0)
- return ret;
-
- if (ip_hdr(skb)->protocol != IPPROTO_IGMP)
- return -ENOMSG;
-
- return __ip_mc_check_igmp(skb);
-}
-
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
diff --git a/compat-sources/net/ipv6/mcast_snoop.c b/compat-sources/net/ipv6/mcast_snoop.c
deleted file mode 100644
index 651b8e3bc4893e63de0e1e64d8d8561dae73d7e8..0000000000000000000000000000000000000000
--- a/compat-sources/net/ipv6/mcast_snoop.c
+++ /dev/null
@@ -1,189 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright (C) 2010: YOSHIFUJI Hideaki <yoshfuji(a)linux-ipv6.org>
- * Copyright (C) 2015: Linus Lüssing <linus.luessing(a)c0d3.blue>
- *
- * Based on the MLD support added to br_multicast.c by YOSHIFUJI Hideaki.
- */
-
-#include <linux/skbuff.h>
-#include <net/ipv6.h>
-#include <net/mld.h>
-#include <net/addrconf.h>
-#include <net/ip6_checksum.h>
-
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-static int ipv6_mc_check_ip6hdr(struct sk_buff *skb)
-{
- const struct ipv6hdr *ip6h;
- unsigned int len;
- unsigned int offset = skb_network_offset(skb) + sizeof(*ip6h);
-
- if (!pskb_may_pull(skb, offset))
- return -EINVAL;
-
- ip6h = ipv6_hdr(skb);
-
- if (ip6h->version != 6)
- return -EINVAL;
-
- len = offset + ntohs(ip6h->payload_len);
- if (skb->len < len || len <= offset)
- return -EINVAL;
-
- return 0;
-}
-
-static int ipv6_mc_check_exthdrs(struct sk_buff *skb)
-{
- const struct ipv6hdr *ip6h;
- int offset;
- u8 nexthdr;
- __be16 frag_off;
-
- ip6h = ipv6_hdr(skb);
-
- if (ip6h->nexthdr != IPPROTO_HOPOPTS)
- return -ENOMSG;
-
- nexthdr = ip6h->nexthdr;
- offset = skb_network_offset(skb) + sizeof(*ip6h);
- offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off);
-
- if (offset < 0)
- return -EINVAL;
-
- if (nexthdr != IPPROTO_ICMPV6)
- return -ENOMSG;
-
- skb_set_transport_header(skb, offset);
-
- return 0;
-}
-
-static int ipv6_mc_check_mld_reportv2(struct sk_buff *skb)
-{
- unsigned int len = skb_transport_offset(skb);
-
- len += sizeof(struct mld2_report);
-
- return pskb_may_pull(skb, len) ? 0 : -EINVAL;
-}
-
-static int ipv6_mc_check_mld_query(struct sk_buff *skb)
-{
- struct mld_msg *mld;
- unsigned int len = skb_transport_offset(skb);
-
- /* RFC2710+RFC3810 (MLDv1+MLDv2) require link-local source addresses */
- if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL))
- return -EINVAL;
-
- len += sizeof(struct mld_msg);
- if (skb->len < len)
- return -EINVAL;
-
- /* MLDv1? */
- if (skb->len != len) {
- /* or MLDv2? */
- len += sizeof(struct mld2_query) - sizeof(struct mld_msg);
- if (skb->len < len || !pskb_may_pull(skb, len))
- return -EINVAL;
- }
-
- mld = (struct mld_msg *)skb_transport_header(skb);
-
- /* RFC2710+RFC3810 (MLDv1+MLDv2) require the multicast link layer
- * all-nodes destination address (ff02::1) for general queries
- */
- if (ipv6_addr_any(&mld->mld_mca) &&
- !ipv6_addr_is_ll_all_nodes(&ipv6_hdr(skb)->daddr))
- return -EINVAL;
-
- return 0;
-}
-
-static int ipv6_mc_check_mld_msg(struct sk_buff *skb)
-{
- struct mld_msg *mld = (struct mld_msg *)skb_transport_header(skb);
-
- switch (mld->mld_type) {
- case ICMPV6_MGM_REDUCTION:
- case ICMPV6_MGM_REPORT:
- /* fall through */
- return 0;
- case ICMPV6_MLD2_REPORT:
- return ipv6_mc_check_mld_reportv2(skb);
- case ICMPV6_MGM_QUERY:
- return ipv6_mc_check_mld_query(skb);
- default:
- return -ENOMSG;
- }
-}
-
-static inline __sum16 ipv6_mc_validate_checksum(struct sk_buff *skb)
-{
- return skb_checksum_validate(skb, IPPROTO_ICMPV6, ip6_compute_pseudo);
-}
-
-static int __ipv6_mc_check_mld(struct sk_buff *skb)
-
-{
- struct sk_buff *skb_chk = NULL;
- unsigned int transport_len;
- unsigned int len = skb_transport_offset(skb) + sizeof(struct mld_msg);
- int ret;
-
- transport_len = ntohs(ipv6_hdr(skb)->payload_len);
- transport_len -= skb_transport_offset(skb) - sizeof(struct ipv6hdr);
-
- skb_get(skb);
- skb_chk = skb_checksum_trimmed(skb, transport_len,
- ipv6_mc_validate_checksum);
- if (!skb_chk)
- return -EINVAL;
-
- if (!pskb_may_pull(skb_chk, len)) {
- kfree_skb(skb_chk);
- return -EINVAL;
- }
-
- ret = ipv6_mc_check_mld_msg(skb_chk);
- if (ret) {
- kfree_skb(skb_chk);
- return ret;
- }
-
- kfree_skb(skb_chk);
-
- return 0;
-}
-
-/**
- * ipv6_mc_check_mld - checks whether this is a sane MLD packet
- * @skb: the skb to validate
- *
- * Checks whether an IPv6 packet is a valid MLD packet. If so sets
- * skb network and transport headers accordingly and returns zero.
- *
- * -EINVAL: A broken packet was detected, i.e. it violates some internet
- * standard
- * -ENOMSG: IP header validation succeeded but it is not an MLD packet.
- * -ENOMEM: A memory allocation failure happened.
- */
-int ipv6_mc_check_mld(struct sk_buff *skb)
-{
- int ret;
-
- ret = ipv6_mc_check_ip6hdr(skb);
- if (ret < 0)
- return ret;
-
- ret = ipv6_mc_check_exthdrs(skb);
- if (ret < 0)
- return ret;
-
- return __ipv6_mc_check_mld(skb);
-}
-
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
diff --git a/compat.h b/compat.h
index 21bacc5d3b6d029560c66c67decb7b00c3ddc2aa..e3220e396411d2cb97ca432599a1bf5933da463a 100644
--- a/compat.h
+++ b/compat.h
@@ -15,19 +15,6 @@
#include "compat-autoconf.h"
-#if LINUX_VERSION_IS_LESS(4, 0, 0)
-
-/* wild hack for batadv_getlink_net only */
-#define get_link_net get_xstats_size || 1 ? fallback_net : (struct net*)netdev->rtnl_link_ops->get_xstats_size
-
-#endif /* LINUX_VERSION_IS_LESS(4, 0, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 3, 0)
-
-#define IFF_NO_QUEUE 0; dev->tx_queue_len = 0
-
-#endif /* LINUX_VERSION_IS_LESS(4, 3, 0) */
-
#if LINUX_VERSION_IS_LESS(4, 15, 0)
#define batadv_softif_slave_add(__dev, __slave_dev, __extack) \
2 years, 7 months