batman-adv: update to version 2025.5
authorSven Eckelmann <sven@narfation.org>
Sat, 20 Dec 2025 17:30:59 +0000 (18:30 +0100)
committerSven Eckelmann <sven@narfation.org>
Sat, 20 Dec 2025 17:42:42 +0000 (18:42 +0100)
* support latest kernels (5.10 - 6.19)
* coding style cleanups and refactoring

Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv/Makefile
batman-adv/patches/0002-Revert-batman-adv-Switch-to-linux-array_size.h.patch
batman-adv/src/compat-hacks.h

index 394f1e13401a4745b262a813d516955d847fede5..c61ed0970abf24757141a16e5600a2afa9754111 100644 (file)
@@ -3,12 +3,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=batman-adv
-PKG_VERSION:=2025.4
+PKG_VERSION:=2025.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
-PKG_HASH:=62490a8f8b58c02e819216f3e963249984645d3e460156a043b73fc53e24f86d
+PKG_HASH:=1adbe823991e9718e307f3766ea96405fe1f284c19bcb98c662d7a1faa324c35
 PKG_EXTMOD_SUBDIRS:=net/batman-adv
 
 PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
index cbc4042034ec9d388d58e3fdc81f91467252f81a..acf6827f372a3883d7bb3f377811e3cd9590c632 100644 (file)
@@ -10,7 +10,7 @@ This reverts commit f33d7f724675544a36b24c77f8d4b95d41252ae2.
 
 --- a/compat-include/linux/array_size.h
 +++ /dev/null
-@@ -1,20 +0,0 @@
+@@ -1,23 +0,0 @@
 -/* SPDX-License-Identifier: GPL-2.0 */
 -/* Copyright (C) B.A.T.M.A.N. contributors:
 - *
@@ -24,7 +24,10 @@ This reverts commit f33d7f724675544a36b24c77f8d4b95d41252ae2.
 -#define _NET_BATMAN_ADV_COMPAT_LINUX_ARRAY_SIZE_H_
 -
 -#include <linux/version.h>
--#if LINUX_VERSION_IS_GEQ(6, 7, 0)
+-#if (LINUX_VERSION_IS_GEQ(5, 15, 197) && LINUX_VERSION_IS_LESS(5, 16, 0)) || \
+-    (LINUX_VERSION_IS_GEQ(6, 1, 159) && LINUX_VERSION_IS_LESS(6, 2, 0)) || \
+-    (LINUX_VERSION_IS_GEQ(6, 6, 118) && LINUX_VERSION_IS_LESS(6, 7, 0)) || \
+-    LINUX_VERSION_IS_GEQ(6, 7, 0)
 -#include_next <linux/array_size.h>
 -#else
 -#include <linux/kernel.h>
index 57911f47511948c9ddcc667fd4f3eb44052839a0..3df70427343c91c0ac09caa87fb06c15158dc322 100644 (file)
 
 #endif /* LINUX_VERSION_IS_LESS(6, 16, 0) */
 
+#if LINUX_VERSION_IS_LESS(6, 16, 0) || !defined(CONFIG_NET_CRC32C)
+
+#include <linux/skbuff.h>
+#include <linux/crc32.h>
+
+static inline u32 batadv_skb_crc32c(struct sk_buff *skb, int offset,
+                                   int len, u32 crc)
+{
+       unsigned int to = offset + len;
+       unsigned int consumed = 0;
+       struct skb_seq_state st;
+       unsigned int l;
+       const u8 *data;
+
+       if (len <= 0)
+              return crc;
+
+       skb_prepare_seq_read(skb, offset, to, &st);
+       while ((l = skb_seq_read(consumed, &data, &st)) != 0) {
+               crc = crc32c(crc, data, l);
+               consumed += l;
+       }
+
+       return crc;
+}
+
+#define skb_crc32c batadv_skb_crc32c
+
+#endif /* LINUX_VERSION_IS_LESS(6, 16, 0) || !defined(CONFIG_NET_CRC32C) */
+
 /* <DECLARE_EWMA> */
 
 #include <linux/version.h>