diff options
author | Eric Dumazet <edumazet@google.com> | 2023-09-12 18:02:00 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-09-15 11:33:46 +0200 |
commit | d986f52124e062753e33b6fe303be5904a997eac (patch) | |
tree | e565543f2059fbdeb5f97f5383941fe6f4b42869 /net/core/sock.c | |
parent | ipv6: lockless IPV6_UNICAST_HOPS implementation (diff) | |
download | linux-d986f52124e062753e33b6fe303be5904a997eac.tar.xz linux-d986f52124e062753e33b6fe303be5904a997eac.zip |
ipv6: lockless IPV6_MULTICAST_LOOP implementation
Add inet6_{test|set|clear|assign}_bit() helpers.
Note that I am using bits from inet->inet_flags,
this might change in the future if we need more flags.
While solving data-races accessing np->mc_loop,
this patch also allows to implement lockless accesses
to np->mcast_hops in the following patch.
Also constify sk_mc_loop() argument.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index bb89b88bc1e8..213a62ac13f2 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -759,7 +759,7 @@ out: return ret; } -bool sk_mc_loop(struct sock *sk) +bool sk_mc_loop(const struct sock *sk) { if (dev_recursion_level()) return false; @@ -771,7 +771,7 @@ bool sk_mc_loop(struct sock *sk) return inet_test_bit(MC_LOOP, sk); #if IS_ENABLED(CONFIG_IPV6) case AF_INET6: - return inet6_sk(sk)->mc_loop; + return inet6_test_bit(MC6_LOOP, sk); #endif } WARN_ON_ONCE(1); |