batman-adv: update to version 2021.1
[feed/routing.git] / batman-adv / patches / 0003-batman-adv-Fix-build-of-multicast-code-against-Linux.patch
1 From: Sven Eckelmann <sven@narfation.org>
2 Date: Fri, 14 May 2021 19:34:35 +0200
3 Subject: batman-adv: Fix build of multicast code against Linux < 5.13
4
5 Fixes: 007b4c4b031f ("batman-adv: convert ifmcaddr6 to RCU")
6 Signed-off-by: Sven Eckelmann <sven@narfation.org>
7
8 diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
9 index 1d63c8cbbfe7b16e360e91bcf3bb77ec7b12893b..ece9fb5dd81bfadbdbe15363dfd8fd257dbe942f 100644
10 --- a/net/batman-adv/multicast.c
11 +++ b/net/batman-adv/multicast.c
12 @@ -454,9 +454,14 @@ batadv_mcast_mla_softif_get_ipv6(struct net_device *dev,
13 return 0;
14 }
15
16 +#if LINUX_VERSION_IS_LESS(5, 13, 0)
17 + read_lock_bh(&in6_dev->lock);
18 + for (pmc6 = in6_dev->mc_list; pmc6; pmc6 = pmc6->next) {
19 +#else
20 for (pmc6 = rcu_dereference(in6_dev->mc_list);
21 pmc6;
22 pmc6 = rcu_dereference(pmc6->next)) {
23 +#endif
24 if (IPV6_ADDR_MC_SCOPE(&pmc6->mca_addr) <
25 IPV6_ADDR_SCOPE_LINKLOCAL)
26 continue;
27 @@ -485,6 +490,9 @@ batadv_mcast_mla_softif_get_ipv6(struct net_device *dev,
28 hlist_add_head(&new->list, mcast_list);
29 ret++;
30 }
31 +#if LINUX_VERSION_IS_LESS(5, 13, 0)
32 + read_unlock_bh(&in6_dev->lock);
33 +#endif
34 rcu_read_unlock();
35
36 return ret;