batman-adv: update to version 2021.3
authorSven Eckelmann <sven@narfation.org>
Tue, 14 Sep 2021 19:14:11 +0000 (21:14 +0200)
committerSven Eckelmann <sven@narfation.org>
Tue, 14 Sep 2021 19:14:11 +0000 (21:14 +0200)
* support latest kernels (4.4 - 5.15)
* coding style cleanups and refactoring
* reduced memory copy overhead when sending broadcasts

Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv/Makefile
batman-adv/patches/0001-Revert-batman-adv-genetlink-move-to-smaller-ops-wher.patch
batman-adv/patches/0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch
batman-adv/patches/0004-Revert-batman-adv-Switch-to-kstrtox.h-for-kstrtou64.patch [new file with mode: 0644]
batman-adv/patches/0005-Revert-batman-adv-use-Linux-s-stdarg.h.patch [new file with mode: 0644]
batman-adv/src/compat-hacks.h

index d92d6e8e9aa8cf092a41e3db1a1f5363ce60d20f..967965ee745952f344c3b541649b80773b114267 100644 (file)
@@ -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 <sw@simonwunderlich.de>
index ba8254e687a8d090683d403ed0dd7479fdfc3c31..68187b0acb68bd34e6230d74a830b98983e5041c 100644 (file)
@@ -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,
index 46f9d1dd0f9aada11aadecc0a0b8a25529760eca..6fecb6cd3778ce61d474adf3ffe712c8012e38b6 100644 (file)
@@ -7,7 +7,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
 
 --- 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 <sven@narfation.org>
                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 (file)
index 0000000..8a2c0e2
--- /dev/null
@@ -0,0 +1,19 @@
+From: Sven Eckelmann <sven@narfation.org>
+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 <linux/atomic.h>
+ #include <linux/byteorder/generic.h>
+ #include <linux/errno.h>
+-#include <linux/kstrtox.h>
++#include <linux/kernel.h>
+ #include <linux/limits.h>
+ #include <linux/math64.h>
+ #include <linux/netdevice.h>
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 (file)
index 0000000..ce2df71
--- /dev/null
@@ -0,0 +1,19 @@
+From: Sven Eckelmann <sven@narfation.org>
+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 <linux/stdarg.h>
++#include <stdarg.h>
+ #include "trace.h"
index f949f4e198e711385637228780db26329ab1b86d..0b8b2e18164a8bfb3f8c079d69c655634b112adf 100644 (file)
@@ -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) */
+
 /* <DECLARE_EWMA> */
 
 #include <linux/version.h>