Skip to contentSkip to conversation

batman-adv: Drop support for Linux < 3.16

PATCH Applied Sven Eckelmann 2 participants 4 messages Jun 1, 2018 – Jun 3, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Drop support for Linux < 3.16

The Linux Kernel 3.2 reached its end of life [1] after over 6 years. Instead it is recommended to use at least kernel 3.16 which is also already over 3 years old. All older kernels (v3.2 - v3.15) should therefore be dropped to reduce the support overhead.

[1] https://lkml.kernel.org/r/[email protected]

---
 Makefile                               |  42 ++-----
 README.external.rst                    |   2 +-
 compat-include/linux/etherdevice.h     |  55 ---------
 compat-include/linux/export.h          |  30 -----
 compat-include/linux/genetlink.h       |  34 ------
 compat-include/linux/if_ether.h        |  34 ------
 compat-include/linux/if_vlan.h         |  34 ------
 compat-include/linux/kernel.h          |  45 --------
 compat-include/linux/kref.h            |  47 --------
 compat-include/linux/list.h            |  21 ----
 compat-include/linux/net.h             |  40 -------
 compat-include/linux/netdev_features.h |  36 ------
 compat-include/linux/netdevice.h       |  32 +-----
 compat-include/linux/netlink.h         |  18 ---
 compat-include/linux/random.h          |  34 ------
 compat-include/linux/rculist.h         |  40 -------
 compat-include/linux/skbuff.h          |  32 ------
 compat-include/linux/slab.h            |  34 ------
 compat-include/linux/timer.h           |  11 --
 compat-include/net/genetlink.h         | 147 -------------------------
 compat-include/net/ipv6.h              |  38 -------
 compat-include/net/netlink.h           |  11 --
 compat-include/uapi/linux/eventpoll.h  |   4 -
 compat-include/uapi/linux/nl80211.h    |   4 -
 compat-patches/README                  |  25 -----
 compat-patches/replacements.sh         |  25 -----
 compat-sources/Makefile                |   6 +-
 compat.h                               |  98 -----------------
 28 files changed, 14 insertions(+), 965 deletions(-)
 delete mode 100644 compat-include/linux/etherdevice.h
 delete mode 100644 compat-include/linux/export.h
 delete mode 100644 compat-include/linux/genetlink.h
 delete mode 100644 compat-include/linux/if_ether.h
 delete mode 100644 compat-include/linux/if_vlan.h
 delete mode 100644 compat-include/linux/kernel.h
 delete mode 100644 compat-include/linux/kref.h
 delete mode 100644 compat-include/linux/net.h
 delete mode 100644 compat-include/linux/netdev_features.h
 delete mode 100644 compat-include/linux/random.h
 delete mode 100644 compat-include/linux/rculist.h
 delete mode 100644 compat-include/linux/slab.h
 delete mode 100644 compat-include/net/genetlink.h
 delete mode 100644 compat-include/net/ipv6.h
 delete mode 100644 compat-patches/README
 delete mode 100755 compat-patches/replacements.sh
Makefile +9 -33
index ea995216..7c6fa1e4 100644
@@ -33,7 +33,6 @@ export CONFIG_BATMAN_ADV_MCAST=y
 export CONFIG_BATMAN_ADV_BATMAN_V=y
 
 PWD:=$(shell pwd)
-BUILD_DIR=$(PWD)/build
 KERNELPATH ?= /lib/modules/$(shell uname -r)/build
 # sanity check: does KERNELPATH exist?
 ifeq ($(shell cd $(KERNELPATH) && pwd),)
@@ -42,30 +41,23 @@ endif
 
 export KERNELPATH
 RM ?= rm -f
-MKDIR := mkdir -p
-PATCH_FLAGS = --batch --fuzz=0 --forward --strip=1 --unified --version-control=never -g0 --remove-empty-files --no-backup-if-mismatch --reject-file=-
-PATCH := patch $(PATCH_FLAGS) -i
 CP := cp -fpR
 LN := ln -sf
 
-SOURCE = $(wildcard net/batman-adv/*.[ch]) net/batman-adv/Makefile
-SOURCE_BUILD = $(wildcard $(BUILD_DIR)/net/batman-adv/*.[ch]) $(BUILD_DIR)/net/batman-adv/Makefile
-SOURCE_STAMP = $(BUILD_DIR)/net/batman-adv/.compat-prepared
-
 REVISION= $(shell	if [ -d "$(PWD)/.git" ]; then \
 				echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
 			fi)
 NOSTDINC_FLAGS += \
-	-I$(PWD)/../compat-include/ \
-	-I$(PWD)/../include/ \
-	-include $(PWD)/../compat.h \
+	-I$(PWD)/compat-include/ \
+	-I$(PWD)/include/ \
+	-include $(PWD)/compat.h \
 	$(CFLAGS)
 
 ifneq ($(REVISION),)
 NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
 endif
 
--include $(PWD)/../compat-sources/Makefile
+include $(PWD)/compat-sources/Makefile
 
 obj-y += net/batman-adv/
 
@@ -73,8 +65,8 @@ export batman-adv-y
 
 
 BUILD_FLAGS := \
-	M=$(BUILD_DIR) \
-	PWD=$(BUILD_DIR) \
+	M=$(PWD) \
+	PWD=$(PWD) \
 	REVISION=$(REVISION) \
 	CONFIG_BATMAN_ADV=m \
 	CONFIG_BATMAN_ADV_DEBUG=$(CONFIG_BATMAN_ADV_DEBUG) \
@@ -86,34 +78,18 @@ BUILD_FLAGS := \
 	CONFIG_BATMAN_ADV_BATMAN_V=$(CONFIG_BATMAN_ADV_BATMAN_V) \
 	INSTALL_MOD_DIR=updates/
 
-all: config $(SOURCE_STAMP)
+all: config
 	$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS)	modules
 
 clean:
 	$(RM) compat-autoconf.h*
-	$(RM) -r $(BUILD_DIR)
+	$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) clean
 
-install: config $(SOURCE_STAMP)
+install: config
 	$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) modules_install
 	depmod -a
 
 config:
 	$(PWD)/gen-compat-autoconf.sh $(PWD)/compat-autoconf.h
 
-$(SOURCE_STAMP): $(SOURCE) compat-patches/* compat-patches/replacements.sh
-	$(MKDIR) $(BUILD_DIR)/net/batman-adv/
-	@$(LN) ../Makefile $(BUILD_DIR)/Makefile
-	@$(RM) $(SOURCE_BUILD)
-	@$(CP) $(SOURCE) $(BUILD_DIR)/net/batman-adv/
-	@set -e; \
-	patches="$$(ls -1 compat-patches/|grep '.patch$$'|sort)"; \
-	for i in $${patches}; do \
-		echo '  COMPAT_PATCH '$${i};\
-		cd $(BUILD_DIR); \
-		$(PATCH) ../compat-patches/$${i}; \
-		cd - > /dev/null; \
-	done
-	compat-patches/replacements.sh
-	touch $(SOURCE_STAMP)
-
 .PHONY: all clean install config
README.external.rst +1 -1
index a6f14a03..6c3e0c85 100644
@@ -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.2 -  4.17.  Supporting   older   versions   is   not
+with Linux 3.16 -  4.17.  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.  :-)
 
compat-include/linux/etherdevice.h deleted +0 -55

55 lines not on this page · raw message

compat-include/linux/export.h deleted +0 -30
deleted file mode 100644
index 5fb590fc..00000000
@@ -1,30 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_EXPORT_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_EXPORT_H_
-
-#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
-#include_next <linux/export.h>
-#endif
-
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_EXPORT_H_ */
compat-include/linux/genetlink.h deleted +0 -34
deleted file mode 100644
index ec778782..00000000
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_GENETLINK_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_GENETLINK_H_
-
-#include <linux/version.h>
-#include_next <linux/genetlink.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
-
-#define MODULE_ALIAS_GENL_FAMILY(family)
-
-#endif /* < KERNEL_VERSION(3, 5, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_GENETLINK_H_ */
compat-include/linux/if_ether.h deleted +0 -34
deleted file mode 100644
index d2f683f9..00000000
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_IF_ETHER_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_IF_ETHER_H_
-
-#include <linux/version.h>
-#include_next <linux/if_ether.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
-
-#define ETH_P_BATMAN	0x4305
-
-#endif /* < KERNEL_VERSION(3, 8, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_IF_ETHER_H_ */
compat-include/linux/if_vlan.h deleted +0 -34
deleted file mode 100644
index 716040d8..00000000
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_IF_VLAN_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_IF_VLAN_H_
-
-#include <linux/version.h>
-#include_next <linux/if_vlan.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
-
-#define vlan_insert_tag(skb, proto, vid) vlan_insert_tag(skb, vid)
-
-#endif /* < KERNEL_VERSION(3, 10, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_IF_VLAN_H_ */
compat-include/linux/kernel.h deleted +0 -45

45 lines not on this page · raw message

compat-include/linux/kref.h deleted +0 -47

47 lines not on this page · raw message

compat-include/linux/list.h +0 -21
index 224c600e..c542236e 100644
@@ -25,27 +25,6 @@
 #include <linux/version.h>
 #include_next <linux/list.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
-
-#define hlist_entry_safe(ptr, type, member) \
-	({ typeof(ptr) ____ptr = (ptr); \
-	   ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
-	})
-
-#undef hlist_for_each_entry
-#define hlist_for_each_entry(pos, head, member) \
-	for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
-	pos; \
-	pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
-
-#undef hlist_for_each_entry_safe
-#define hlist_for_each_entry_safe(pos, n, head, member) \
-	for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\
-	pos && ({ n = pos->member.next; 1; }); \
-	pos = hlist_entry_safe(n, typeof(*pos), member))
-
-#endif /* < KERNEL_VERSION(3, 9, 0) */
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
 
 #define hlist_add_behind(n, prev) hlist_add_after(prev, n)
compat-include/linux/net.h deleted +0 -40
deleted file mode 100644
index fe24a1fb..00000000
@@ -1,40 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_NET_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_NET_H_
-
-#include <linux/version.h>
-#include_next <linux/net.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
-
-#ifndef net_ratelimited_function
-#define net_ratelimited_function(func, ...) \
-	do { \
-		if (net_ratelimit()) \
-			func(__VA_ARGS__); \
-	} while (0)
-#endif /* ifndef net_ratelimited_function */
-
-#endif /* < KERNEL_VERSION(3, 5, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_NET_H_ */
compat-include/linux/netdev_features.h deleted +0 -36
deleted file mode 100644
index 27b4a398..00000000
@@ -1,36 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_NETDEV_FEATURES_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_NETDEV_FEATURES_H_
-
-#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
-#include_next <linux/netdev_features.h>
-#endif /* >= KERNEL_VERSION(3, 3, 0) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
-
-#define NETIF_F_HW_VLAN_CTAG_FILTER NETIF_F_HW_VLAN_FILTER
-
-#endif /* < KERNEL_VERSION(3, 10, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_NETDEV_FEATURES_H_ */
compat-include/linux/netdevice.h +1 -31
index 4e03f4f4..8f099cf4 100644
@@ -25,31 +25,6 @@
 #include <linux/version.h>
 #include_next <linux/netdevice.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
-
-#include <linux/netdev_features.h>
-
-#endif /* < KERNEL_VERSION(3, 3, 0) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
-
-#define netdev_upper_dev_unlink(slave, master) netdev_set_master(slave, NULL)
-#define netdev_master_upper_dev_get(dev) \
-({\
-	ASSERT_RTNL();\
-	dev->master;\
-})
-
-#endif /* < KERNEL_VERSION(3, 9, 0) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
-
-#define NETDEV_CHANGEUPPER	0x0015
-
-#define netdev_notifier_info_to_dev(ptr) ptr
-
-#endif /* < KERNEL_VERSION(3, 11, 0) */
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
 
 /* alloc_netdev() was defined differently before 2.6.38 */
@@ -65,12 +40,7 @@
 
 #endif /* < KERNEL_VERSION(3, 19, 0) */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
-
-#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) \
-	netdev_set_master(dev, upper_dev)
-
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
 
 #define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) \
 	netdev_master_upper_dev_link(dev, upper_dev)
compat-include/linux/netlink.h +0 -18
index 3f77265b..eb42b2b6 100644
@@ -25,24 +25,6 @@
 #include <linux/version.h>
 #include_next <linux/netlink.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)
-
-#include <net/scm.h>
-
-struct batadv_netlink_skb_parms {
-	struct ucred		creds;		/* Skb credentials	*/
-	union {
-		__u32		portid;
-		__u32		pid;
-	};
-	__u32			dst_group;
-};
-
-#undef NETLINK_CB
-#define NETLINK_CB(skb) (*(struct batadv_netlink_skb_parms *)&((skb)->cb))
-
-#endif /* < KERNEL_VERSION(3, 7, 0) */
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)
 
 #include_next <net/netlink.h>
compat-include/linux/random.h deleted +0 -34
deleted file mode 100644
index 04d44ebc..00000000
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_RANDOM_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_RANDOM_H_
-
-#include <linux/version.h>
-#include_next <linux/random.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
-
-#define prandom_u32() random32()
-
-#endif /* < KERNEL_VERSION(3, 9, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_RANDOM_H_ */
compat-include/linux/rculist.h deleted +0 -40
deleted file mode 100644
index a8878060..00000000
@@ -1,40 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_RCULIST_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_RCULIST_H_
-
-#include <linux/version.h>
-#include_next <linux/rculist.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
-
-#undef hlist_for_each_entry_rcu
-#define hlist_for_each_entry_rcu(pos, head, member) \
-	for (pos = hlist_entry_safe(rcu_dereference_raw(hlist_first_rcu(head)),\
-	typeof(*(pos)), member); \
-	pos; \
-	pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\
-	&(pos)->member)), typeof(*(pos)), member))
-
-#endif
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_RCULIST_H_ */
compat-include/linux/skbuff.h +0 -32
index 371bb561..36e4d10d 100644
@@ -25,38 +25,6 @@
 #include <linux/version.h>
 #include_next <linux/skbuff.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
-
-/* hack for not correctly set mac_len. This may happen for some special
- * configurations like batman-adv on VLANs.
- *
- * This is pretty dirty, but we only use skb_share_check() in main.c right
- * before mac_len is checked, and the recomputation shouldn't hurt too much.
- */
-#define skb_share_check(skb, b) \
-	({ \
-		struct sk_buff *_t_skb; \
-		_t_skb = skb_share_check(skb, b); \
-		if (_t_skb) \
-			skb_reset_mac_len(_t_skb); \
-		_t_skb; \
-	})
-
-#endif /* < KERNEL_VERSION(3, 8, 0) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
-
-/* older kernels still need to call skb_abort_seq_read() */
-#define skb_seq_read(consumed, data, st) \
-	({ \
-		int __len = skb_seq_read(consumed, data, st); \
-		if (__len == 0) \
-			skb_abort_seq_read(st); \
-		__len; \
-	})
-
-#endif /* < KERNEL_VERSION(3, 11, 0) */
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
 
 #define pskb_copy_for_clone pskb_copy
compat-include/linux/slab.h deleted +0 -34
deleted file mode 100644
index e74f46ab..00000000
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_SLAB_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_SLAB_H_
-
-#include <linux/version.h>
-#include_next <linux/slab.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
-
-#define kmalloc_array(n, size, flags) kmalloc(n * size, flags)
-
-#endif /* < KERNEL_VERSION(3, 4, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_SLAB_H_ */
compat-include/linux/timer.h +0 -11
index 74b9b9b2..262c3861 100644
@@ -25,17 +25,6 @@
 #include <linux/version.h>
 #include_next <linux/timer.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)
-
-#define __setup_timer(_timer, _fn, _data, _flags) \
-	do { \
-		init_timer(_timer); \
-		(_timer)->function = (_fn); \
-		(_timer)->data = (_data); \
-	} while (0)
-
-#endif /* < KERNEL_VERSION(3, 7, 0) */
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
 
 #define TIMER_DATA_TYPE		unsigned long
compat-include/net/genetlink.h deleted +0 -147

147 lines not on this page · raw message

compat-include/net/ipv6.h deleted +0 -38
deleted file mode 100644
index b27d0ce0..00000000
@@ -1,38 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_NET_IPV6_H_
-#define _NET_BATMAN_ADV_COMPAT_NET_IPV6_H_
-
-#include <linux/version.h>
-#include_next <net/ipv6.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
-
-#define ipv6_skip_exthdr(skb, start, nexthdrp, frag_offp) \
-	({ \
-		(void)frag_offp; \
-		ipv6_skip_exthdr(skb, start, nexthdrp); \
-	})
-
-#endif /* < KERNEL_VERSION(3, 3, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_NET_IPV6_H_ */
compat-include/net/netlink.h +0 -11
index d43576e2..c395dafb 100644
@@ -25,17 +25,6 @@
 #include <linux/version.h>
 #include_next <net/netlink.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
-
-static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
-{
-	__be32 tmp = value;
-
-	return nla_put(skb, attrtype, sizeof(__be32), &tmp);
-}
-
-#endif /* < KERNEL_VERSION(3, 5, 0) */
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)
 
 static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype,
compat-include/uapi/linux/eventpoll.h +0 -4
index 331687ae..1828feb4 100644
@@ -24,11 +24,7 @@
 
 #include <linux/version.h>
 #include <linux/types.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
 #include_next <uapi/linux/eventpoll.h>
-#else
-#include <linux/eventpoll.h>
-#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
 
compat-include/uapi/linux/nl80211.h +0 -4
index 724ab2a6..3e743249 100644
@@ -23,11 +23,7 @@
 #define _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_
 
 #include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
 #include_next <uapi/linux/nl80211.h>
-#else
-#include <linux/nl80211.h>
-#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
 
compat-patches/README deleted +0 -25
deleted file mode 100644
index ceafb1da..00000000
@@ -1,25 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-WARNING
-=======
-
-Please avoid using the compat-patches/ to implement support for old kernels.
-This should be the last resort.
-
- * it is nearly always possible to use compat-includes/ to do the same with a
-   lot less problems
-
- * maintaining these patches is *censored*
-
-GENERATING A PATCH
-==================
-
-If it not possible to avoid a patch then please make the patch as small as
-possible. Even refactor the code which has to be patched to reduce the
-size/number of the changes.
-
-Please use git-format-patches to generate them and order same inside via the
-XXXX- prefix of the patch name.
-
-    git format-patch --abbrev=7 -U3 --diff-algorithm=histogram --no-signature \
-	--format=format:'From: %an <%ae>%nDate: %aD%nSubject: [PATCH] %B' -1
compat-patches/replacements.sh deleted +0 -25
deleted file mode 100755
index 1f43c0da..00000000
@@ -1,25 +0,0 @@
-#! /bin/sh
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (C) 2007-2018  B.A.T.M.A.N. contributors:
-#
-# Marek Lindner, Simon Wunderlich
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of version 2 of the GNU General Public
-# License as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-
-set -e
-
-# for kernel < 3.13 to make netlink compat code work
-sed -i \
-	-e 's/^static const struct genl_multicast_group batadv_netlink_mcgrps/static __genl_const struct genl_multicast_group batadv_netlink_mcgrps/' \
-	-e 's/^static const struct genl_ops batadv_netlink_ops/static __genl_const struct genl_ops batadv_netlink_ops/' \
-	build/net/batman-adv/netlink.c
compat-sources/Makefile +3 -3
index 9f3f5d4b..7aabaac6 100644
@@ -15,6 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
-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
+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
compat.h +0 -98

104 lines not on this page · raw message

Signature · 1 line
2.17.0
#1 lore raw
Quoted 9 lines · On Freitag, 1. Juni 2018 17:38:45 CEST Sven Eckelmann wrote:

The Linux Kernel 3.2 reached its end of life [1] after over 6 years. Instead it is recommended to use at least kernel 3.16 which is also already over 3 years old. All older kernels (v3.2 - v3.15) should therefore be dropped to reduce the support overhead.

[1] https://lkml.kernel.org/r/[email protected]

---

The servers already stopped testing these old versions. And it might also be interesting for everyone that the extra "build/" directory was dropped. We only needed this directory because we had to patch the sources before each build. This is currently not necessary anymore.

Unfortunately, we will have to keep compat-sources and some of the really crude hacks until mid 2020.

Kind regards,
Sven

Acked-by on v1 1/1
#2 lore raw
In reply to Sven Eckelmann

Hi,

Quoted 8 lines · Sven Eckelmann

The Linux Kernel 3.2 reached its end of life [1] after over 6 years. Instead it is recommended to use at least kernel 3.16 which is also already over 3 years old. All older kernels (v3.2 - v3.15) should therefore be dropped to reduce the support overhead.

[1] https://lkml.kernel.org/r/[email protected]

Cheers,

Signature · 1 line
Antonio Quartulli
author Applied
#3 lore raw
In reply to Sven Eckelmann
Quoted 9 lines · On Freitag, 1. Juni 2018 17:38:45 CEST Sven Eckelmann wrote:

The Linux Kernel 3.2 reached its end of life [1] after over 6 years. Instead it is recommended to use at least kernel 3.16 which is also already over 3 years old. All older kernels (v3.2 - v3.15) should therefore be dropped to reduce the support overhead.

[1] https://lkml.kernel.org/r/[email protected]

---

Applied as 7ab78d556b34 [1].

Kind regards,
Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/7ab78d556b343b592aa80f4d84b2dfd14019f2d8