Welcome to mirror list, hosted at ThFree Co, Russian Federation.

0001-batman-adv-Fix-build-of-multicast-code-against-Linux.patch « patches « batman-adv - github.com/openwrt/routing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6fecb6cd3778ce61d474adf3ffe712c8012e38b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Sven Eckelmann <sven@narfation.org>
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 <sven@narfation.org>

--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -422,9 +422,14 @@ batadv_mcast_mla_softif_get_ipv6(struct
 		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;
@@ -453,6 +458,9 @@ batadv_mcast_mla_softif_get_ipv6(struct
 		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;