summaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-12 18:02:12 +0200
committerDavid S. Miller <davem@davemloft.net>2023-09-15 11:33:48 +0200
commit859f8b265fc2a11af0fb0c52b4087e0409250592 (patch)
tree7096c954f2073480a2cb52ef4e443bac1b336679 /net/ipv6/af_inet6.c
parentipv6: lockless IPV6_MTU_DISCOVER implementation (diff)
downloadlinux-859f8b265fc2a11af0fb0c52b4087e0409250592.tar.xz
linux-859f8b265fc2a11af0fb0c52b4087e0409250592.zip
ipv6: lockless IPV6_FLOWINFO_SEND implementation
np->sndflow reads are racy. Use one bit ftom atomic inet->inet_flags instead, IPV6_FLOWINFO_SEND setsockopt() can be lockless. 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/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 48737363377f..c6ad0d6e99b5 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -537,7 +537,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
}
sin->sin6_port = inet->inet_dport;
sin->sin6_addr = sk->sk_v6_daddr;
- if (np->sndflow)
+ if (inet6_test_bit(SNDFLOW, sk))
sin->sin6_flowinfo = np->flow_label;
BPF_CGROUP_RUN_SA_PROG(sk, (struct sockaddr *)sin,
CGROUP_INET6_GETPEERNAME);