From a7b79a1d4fce4f443854115ee4b2ed2aafba5c06 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Tue, 14 Sep 2021 21:14:11 +0200 Subject: [PATCH] batman-adv: update to version 2021.3 * support latest kernels (4.4 - 5.15) * coding style cleanups and refactoring * reduced memory copy overhead when sending broadcasts Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 4 ++-- ...v-genetlink-move-to-smaller-ops-wher.patch | 4 ++-- ...uild-of-multicast-code-against-Linux.patch | 4 ++-- ...dv-Switch-to-kstrtox.h-for-kstrtou64.patch | 19 ++++++++++++++++ ...vert-batman-adv-use-Linux-s-stdarg.h.patch | 19 ++++++++++++++++ batman-adv/src/compat-hacks.h | 22 +++++++++++++++++++ 6 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 batman-adv/patches/0004-Revert-batman-adv-Switch-to-kstrtox.h-for-kstrtou64.patch create mode 100644 batman-adv/patches/0005-Revert-batman-adv-use-Linux-s-stdarg.h.patch diff --git a/batman-adv/Makefile b/batman-adv/Makefile index d92d6e8..967965e 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -3,12 +3,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv -PKG_VERSION:=2021.2 +PKG_VERSION:=2021.3 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) -PKG_HASH:=7a380a193b543b0cd1e30bb697f03d967776192ca0ebd2e433a63ad48ff26d8b +PKG_HASH:=b24deec9baee786ca91085e32f7e09d4cc94f965ae71c9560895f82ec1cc906b PKG_EXTMOD_SUBDIRS:=net/batman-adv PKG_MAINTAINER:=Simon Wunderlich diff --git a/batman-adv/patches/0001-Revert-batman-adv-genetlink-move-to-smaller-ops-wher.patch b/batman-adv/patches/0001-Revert-batman-adv-genetlink-move-to-smaller-ops-wher.patch index ba8254e..68187b0 100644 --- a/batman-adv/patches/0001-Revert-batman-adv-genetlink-move-to-smaller-ops-wher.patch +++ b/batman-adv/patches/0001-Revert-batman-adv-genetlink-move-to-smaller-ops-wher.patch @@ -106,7 +106,7 @@ This reverts commit 725b4ef5be840cfcd0ca33b9393c14dee40c10f7. #endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */ --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c -@@ -1359,7 +1359,7 @@ static void batadv_post_doit(const struc +@@ -1357,7 +1357,7 @@ static void batadv_post_doit(const struc } } @@ -115,7 +115,7 @@ This reverts commit 725b4ef5be840cfcd0ca33b9393c14dee40c10f7. { .cmd = BATADV_CMD_GET_MESH, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, -@@ -1493,8 +1493,8 @@ struct genl_family batadv_netlink_family +@@ -1491,8 +1491,8 @@ struct genl_family batadv_netlink_family .pre_doit = batadv_pre_doit, .post_doit = batadv_post_doit, .module = THIS_MODULE, diff --git a/batman-adv/patches/0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch b/batman-adv/patches/0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch index 46f9d1d..6fecb6c 100644 --- a/batman-adv/patches/0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch +++ b/batman-adv/patches/0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch @@ -7,7 +7,7 @@ Signed-off-by: Sven Eckelmann --- a/net/batman-adv/multicast.c +++ b/net/batman-adv/multicast.c -@@ -423,9 +423,14 @@ batadv_mcast_mla_softif_get_ipv6(struct +@@ -422,9 +422,14 @@ batadv_mcast_mla_softif_get_ipv6(struct return 0; } @@ -22,7 +22,7 @@ Signed-off-by: Sven Eckelmann if (IPV6_ADDR_MC_SCOPE(&pmc6->mca_addr) < IPV6_ADDR_SCOPE_LINKLOCAL) continue; -@@ -454,6 +459,9 @@ batadv_mcast_mla_softif_get_ipv6(struct +@@ -453,6 +458,9 @@ batadv_mcast_mla_softif_get_ipv6(struct hlist_add_head(&new->list, mcast_list); ret++; } diff --git a/batman-adv/patches/0004-Revert-batman-adv-Switch-to-kstrtox.h-for-kstrtou64.patch b/batman-adv/patches/0004-Revert-batman-adv-Switch-to-kstrtox.h-for-kstrtou64.patch new file mode 100644 index 0000000..8a2c0e2 --- /dev/null +++ b/batman-adv/patches/0004-Revert-batman-adv-Switch-to-kstrtox.h-for-kstrtou64.patch @@ -0,0 +1,19 @@ +From: Sven Eckelmann +Date: Tue, 14 Sep 2021 21:02:10 +0200 +Subject: Revert "batman-adv: Switch to kstrtox.h for kstrtou64" + +This header is only available after Linux 5.14 + +This reverts commit c9a69cb4048ebef3a4d91835669011a26d9b7dab. + +--- a/net/batman-adv/gateway_common.c ++++ b/net/batman-adv/gateway_common.c +@@ -10,7 +10,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/batman-adv/patches/0005-Revert-batman-adv-use-Linux-s-stdarg.h.patch b/batman-adv/patches/0005-Revert-batman-adv-use-Linux-s-stdarg.h.patch new file mode 100644 index 0000000..ce2df71 --- /dev/null +++ b/batman-adv/patches/0005-Revert-batman-adv-use-Linux-s-stdarg.h.patch @@ -0,0 +1,19 @@ +From: Sven Eckelmann +Date: Tue, 14 Sep 2021 21:07:34 +0200 +Subject: Revert "batman-adv: use Linux's stdarg.h" + +This header is only available since Linux 5.15 + +This reverts commit 36d059797a14f0e373fdc3c79df7b467435925ad. + +--- a/net/batman-adv/log.c ++++ b/net/batman-adv/log.c +@@ -7,7 +7,7 @@ + #include "log.h" + #include "main.h" + +-#include ++#include + + #include "trace.h" + diff --git a/batman-adv/src/compat-hacks.h b/batman-adv/src/compat-hacks.h index f949f4e..0b8b2e1 100644 --- a/batman-adv/src/compat-hacks.h +++ b/batman-adv/src/compat-hacks.h @@ -92,6 +92,28 @@ br_multicast_has_router_adjacent(struct net_device *dev, int proto) #endif /* LINUX_VERSION_IS_LESS(5, 14, 0) */ +#if LINUX_VERSION_IS_LESS(5, 15, 0) + +static inline void batadv_dev_put(struct net_device *dev) +{ + if (!dev) + return; + + dev_put(dev); +} +#define dev_put batadv_dev_put + +static inline void batadv_dev_hold(struct net_device *dev) +{ + if (!dev) + return; + + dev_hold(dev); +} +#define dev_hold batadv_dev_hold + +#endif /* LINUX_VERSION_IS_LESS(5, 15, 0) */ + /* */ #include -- 2.30.2