Repository : ssh://git@diktynna/batman-adv
On branch : master
commit 56db7c0540e733a1f063ccd6bab1b537a80857eb Author: Eric Dumazet edumazet@google.com Date: Wed Mar 2 20:05:13 2022 +0100
batman-adv: make mc_forwarding atomic
This fixes minor data-races in ip6_mc_input() and batadv_mcast_mla_rtr_flags_softif_get_ipv6()
Signed-off-by: Eric Dumazet edumazet@google.com Signed-off-by: David S. Miller davem@davemloft.net [sven@narfation.org: Add ugly hack to get it building with old kernels] Signed-off-by: Sven Eckelmann sven@narfation.org
56db7c0540e733a1f063ccd6bab1b537a80857eb net/batman-adv/multicast.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c index 1860de73..720c12c0 100644 --- a/net/batman-adv/multicast.c +++ b/net/batman-adv/multicast.c @@ -135,7 +135,11 @@ static u8 batadv_mcast_mla_rtr_flags_softif_get_ipv6(struct net_device *dev) { struct inet6_dev *in6_dev = __in6_dev_get(dev);
+#if LINUX_VERSION_IS_GEQ(5, 18, 0) // UGLY_HACK_NEW + if (in6_dev && atomic_read(&in6_dev->cnf.mc_forwarding)) +#else // UGLY_HACK_OLD if (in6_dev && in6_dev->cnf.mc_forwarding) +#endif // UGLY_HACK_STOP return BATADV_NO_FLAGS; else return BATADV_MCAST_WANT_NO_RTR6;