From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [PATCH] batman-adv: make mc_forwarding atomic
Date: Wed, 2 Mar 2022 20:05:13 +0100 [thread overview]
Message-ID: <20220302190513.417350-1-sven@narfation.org> (raw)
From: Eric Dumazet <edumazet@google.com>
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>
---
net-next commit 145c7a793838 ("ipv6: make mc_forwarding atomic")
I didn't find a good way to handle this. So either we introduce the
auto-patch-before build stuff again or we allow minimal changes like this
which are not in sync with upstream.
I will try to have a look at ways how we can (with our build_tests):
* filter out everything with UGLY_HACK + everything between
UGLY_HACK_OLD + UGLY_HACK_STOP before comparing it with upstream
* have some automatic warning in case someone adds code to linux-merge.git
with UGLY_HACK in it
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;
--
2.30.2
reply other threads:[~2022-03-02 19:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220302190513.417350-1-sven@narfation.org \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).