diff options
author | Eric Dumazet <edumazet@google.com> | 2023-09-22 03:42:19 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-01 19:39:19 +0100 |
commit | 959d5c11601b2b337c364b2e3102d392365e3dd3 (patch) | |
tree | f73ca0bc48ac759666bb259de30bd61bc1c5acfd /net/ipv4/ping.c | |
parent | 3523bc91e4b4da39ccf18a0252d13108877ece0a (diff) |
inet: implement lockless getsockopt(IP_UNICAST_IF)
Add missing READ_ONCE() annotations when reading inet->uc_index
Implementing getsockopt(IP_UNICAST_IF) locklessly seems possible,
the setsockopt() part might not be possible at the moment.
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/ipv4/ping.c')
-rw-r--r-- | net/ipv4/ping.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 50d12b0c8d46..66ad1f95af49 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -777,7 +777,7 @@ static int ping_v4_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) if (!saddr) saddr = inet->mc_addr; } else if (!ipc.oif) - ipc.oif = inet->uc_index; + ipc.oif = READ_ONCE(inet->uc_index); flowi4_init_output(&fl4, ipc.oif, ipc.sockc.mark, tos, scope, sk->sk_protocol, inet_sk_flowi_flags(sk), faddr, |