From 1c3233ca675828e59db6ca999d8deb59dd80f919 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 14 May 2021 19:37:58 +0200 Subject: [PATCH] batman-adv: update to version 2021.1 * support latest kernels (4.4 - 5.13) * coding style cleanups and refactoring * bugs squashed: - correctly initialize padding when sending out translation table TVLVs Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 4 +-- ...v-genetlink-move-to-smaller-ops-wher.patch | 4 +-- ...v-Add-new-include-for-min-max-helper.patch | 20 +++++------ ...uild-of-multicast-code-against-Linux.patch | 36 +++++++++++++++++++ 4 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 batman-adv/patches/0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 050b352..78a0456 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -3,12 +3,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv -PKG_VERSION:=2021.0 +PKG_VERSION:=2021.1 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:=5a989ba580897268373bd516b87b588061f344af773a0f6b038a3d8d2af028a1 +PKG_HASH:=bf77843d8dead75342d673ce7021e4ad037447ce18c64056ae1e3202039934d0 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 d654457..c6c94bb 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 @@ -13,7 +13,7 @@ or newer - otherwise it will not work as expected. This reverts commit 725b4ef5be840cfcd0ca33b9393c14dee40c10f7. diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h -index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533bee89a67 100644 +index 56a9ab22c062b1d0d01ef9d09ce796075d3d6df7..8f542bef10dc0f2682ab2d428c90df9ab97977ce 100644 --- a/compat-include/net/genetlink.h +++ b/compat-include/net/genetlink.h @@ -31,17 +31,15 @@ void batadv_genl_dump_check_consistent(struct netlink_callback *cb, @@ -107,7 +107,7 @@ index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533 #endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */ diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c -index 97bcf149633d850ff4fcece6d7dc0d799adb1444..a8f15c04826af1144db655887b754758fc5ab47a 100644 +index f317d206b411d87b4da2f57e35c3fb78cedfb160..bdac5dbd899a9540d58052fd32c8c89520927390 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -1351,7 +1351,7 @@ static void batadv_post_doit(const struct genl_ops *ops, struct sk_buff *skb, diff --git a/batman-adv/patches/0002-Revert-batman-adv-Add-new-include-for-min-max-helper.patch b/batman-adv/patches/0002-Revert-batman-adv-Add-new-include-for-min-max-helper.patch index a701e71..95ba352 100644 --- a/batman-adv/patches/0002-Revert-batman-adv-Add-new-include-for-min-max-helper.patch +++ b/batman-adv/patches/0002-Revert-batman-adv-Add-new-include-for-min-max-helper.patch @@ -11,12 +11,12 @@ Signed-off-by: Sven Eckelmann diff --git a/compat-include/linux/minmax.h b/compat-include/linux/minmax.h deleted file mode 100644 -index 4b19479bc5ea12c5005485f623decfad90a85cff..0000000000000000000000000000000000000000 +index 9b7269e8a760361c1650b947c77702f0bdcd73d9..0000000000000000000000000000000000000000 --- a/compat-include/linux/minmax.h +++ /dev/null @@ -1,20 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ --/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors: +-/* Copyright (C) B.A.T.M.A.N. contributors: - * - * Marek Lindner, Simon Wunderlich - * @@ -36,7 +36,7 @@ index 4b19479bc5ea12c5005485f623decfad90a85cff..00000000000000000000000000000000 - -#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_MINMAX_H_ */ diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c -index e4455babe4c28f8c1527a17e825675183c37ea1d..22183e954647089ca72a941e744375d72e1f94b0 100644 +index e1ca2b8c315235f234c9061fc73cde2c1b76aa46..eeb3f6d00d8541b377c9703837ef76b05e8d061e 100644 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@ -15,7 +15,6 @@ @@ -48,7 +48,7 @@ index e4455babe4c28f8c1527a17e825675183c37ea1d..22183e954647089ca72a941e744375d7 #include #include diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c -index 0512ea6cd818c22768e601f446ff806cf863163b..79a7dfc32e76c511c5b5d8716cbebf64f6228d9d 100644 +index 423c2d17170387bfe89b83c4e20f06d525a36b30..4d8e3fdb4427a431cab903bc8a20edb816079fd7 100644 --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c @@ -18,7 +18,6 @@ @@ -60,7 +60,7 @@ index 0512ea6cd818c22768e601f446ff806cf863163b..79a7dfc32e76c511c5b5d8716cbebf64 #include #include diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c -index 798d659855d0bcc9d7638901fedeb77d830f1980..8c1148fc73d776c076bdb35896f5536d7378578d 100644 +index a0a9636d17406362f879f342300a18e75424efa5..89ba88322c9c11acc49a9dcd9877ad8767fe713b 100644 --- a/net/batman-adv/bat_v_ogm.c +++ b/net/batman-adv/bat_v_ogm.c @@ -18,7 +18,6 @@ @@ -72,7 +72,7 @@ index 798d659855d0bcc9d7638901fedeb77d830f1980..8c1148fc73d776c076bdb35896f5536d #include #include diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c -index e522f1fcfd9af04ee2d92b1b11ace6960d6f9c9f..ea40e54867573320d44e68524589454db553fb81 100644 +index a5d9d800082bade3a1d52cc040557e41f963fac3..96873d47fac5cb9b4fbfa217eedf1f92818b0e98 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -14,8 +14,8 @@ @@ -86,7 +86,7 @@ index e522f1fcfd9af04ee2d92b1b11ace6960d6f9c9f..ea40e54867573320d44e68524589454d #include #include diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c -index 0f186ddc15e30a9c9f5e4de44b96b2c7b27d8b86..b57e95c959cf064a74a01d25a24bdc495caa6324 100644 +index 4a6a25d551a83b1723e80a349e1a655a2152b0ac..eabde547d308438257622879e77d84c24daa2199 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -18,7 +18,6 @@ @@ -98,7 +98,7 @@ index 0f186ddc15e30a9c9f5e4de44b96b2c7b27d8b86..b57e95c959cf064a74a01d25a24bdc49 #include #include diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c -index ed9d87ce3407614e5e37922fe3039324adb027cc..edc0d53e9ba0a79ad0c37986e15ec362fb009f4f 100644 +index 3ddd66e4c29ef532de33c7182cc0cc470b33fd4f..c552bc4168d0abd7bf6d23e570d583806fb162b1 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c @@ -23,7 +23,6 @@ @@ -110,7 +110,7 @@ index ed9d87ce3407614e5e37922fe3039324adb027cc..edc0d53e9ba0a79ad0c37986e15ec362 #include #include diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c -index a8f15c04826af1144db655887b754758fc5ab47a..dc193618a761c0b451e860ca83921007d286e09b 100644 +index bdac5dbd899a9540d58052fd32c8c89520927390..b6a703ddd8e97e6a02e8d73c5728802f090ab419 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -23,7 +23,6 @@ @@ -122,7 +122,7 @@ index a8f15c04826af1144db655887b754758fc5ab47a..dc193618a761c0b451e860ca83921007 #include #include diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c -index d4e10005df6cd2936a3132e1ad7bd8bf3c1d99b6..db7e3774825b5f5871b23c0e4fa5ce7afb2accd6 100644 +index 789c851732b78ad9d1515f7b171219cc770c7045..46b774c08c947def8f72f260224254b01c3a387d 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -23,7 +23,6 @@ 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 new file mode 100644 index 0000000..cf311d7 --- /dev/null +++ b/batman-adv/patches/0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch @@ -0,0 +1,36 @@ +From: Sven Eckelmann +Date: Fri, 14 May 2021 19:34:35 +0200 +Subject: batman-adv: Fix build of multicast code against Linux < 5.13 + +Fixes: 007b4c4b031f ("batman-adv: convert ifmcaddr6 to RCU") +Signed-off-by: Sven Eckelmann + +diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c +index 1d63c8cbbfe7b16e360e91bcf3bb77ec7b12893b..ece9fb5dd81bfadbdbe15363dfd8fd257dbe942f 100644 +--- a/net/batman-adv/multicast.c ++++ b/net/batman-adv/multicast.c +@@ -454,9 +454,14 @@ batadv_mcast_mla_softif_get_ipv6(struct net_device *dev, + return 0; + } + ++#if LINUX_VERSION_IS_LESS(5, 13, 0) ++ read_lock_bh(&in6_dev->lock); ++ for (pmc6 = in6_dev->mc_list; pmc6; pmc6 = pmc6->next) { ++#else + for (pmc6 = rcu_dereference(in6_dev->mc_list); + pmc6; + pmc6 = rcu_dereference(pmc6->next)) { ++#endif + if (IPV6_ADDR_MC_SCOPE(&pmc6->mca_addr) < + IPV6_ADDR_SCOPE_LINKLOCAL) + continue; +@@ -485,6 +490,9 @@ batadv_mcast_mla_softif_get_ipv6(struct net_device *dev, + hlist_add_head(&new->list, mcast_list); + ret++; + } ++#if LINUX_VERSION_IS_LESS(5, 13, 0) ++ read_unlock_bh(&in6_dev->lock); ++#endif + rcu_read_unlock(); + + return ret; -- 2.30.2