diff options
author | Eric Dumazet <edumazet@google.com> | 2022-02-04 12:15:45 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-02-05 15:20:34 +0000 |
commit | 145c7a793838add5e004e7d49a67654dc7eba147 (patch) | |
tree | f3b1ad3a89c446cccd1184756d0f9f527b32489d /net/ipv6/ip6_input.c | |
parent | 3115ff3c9d3c926ee30d4f22fba2d8ffe5e413b3 (diff) | |
download | lwn-145c7a793838add5e004e7d49a67654dc7eba147.tar.gz lwn-145c7a793838add5e004e7d49a67654dc7eba147.zip |
ipv6: 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>
Diffstat (limited to 'net/ipv6/ip6_input.c')
-rw-r--r-- | net/ipv6/ip6_input.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 80256717868e..d4b1e2c5aa76 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c @@ -508,7 +508,7 @@ int ip6_mc_input(struct sk_buff *skb) /* * IPv6 multicast router mode is now supported ;) */ - if (dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding && + if (atomic_read(&dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding) && !(ipv6_addr_type(&hdr->daddr) & (IPV6_ADDR_LOOPBACK|IPV6_ADDR_LINKLOCAL)) && likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) { |