summaryrefslogtreecommitdiff
path: root/net/ipv4/cipso_ipv4.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-06-04 11:16:03 +0000
committerPaolo Abeni <pabeni@redhat.com>2024-06-06 11:52:52 +0200
commitb4cb4a1391dcdc640c4ade003aaf0ee19cc8d509 (patch)
tree0e1edc28739cb61536a84d2806dc61b25ef07b77 /net/ipv4/cipso_ipv4.c
parent59d0f48160f54c5d0d7f0aba110be2e0f2569296 (diff)
downloadlwn-b4cb4a1391dcdc640c4ade003aaf0ee19cc8d509.tar.gz
lwn-b4cb4a1391dcdc640c4ade003aaf0ee19cc8d509.zip
net: use unrcu_pointer() helper
Toke mentioned unrcu_pointer() existence, allowing to remove some of the ugly casts we have when using xchg() for rcu protected pointers. Also make inet_rcv_compat const. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Toke Høiland-Jørgensen <toke@redhat.com> Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com> Link: https://lore.kernel.org/r/20240604111603.45871-1-edumazet@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/ipv4/cipso_ipv4.c')
-rw-r--r--net/ipv4/cipso_ipv4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index dd6d46015058..3a95c0f13ce3 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -1953,7 +1953,7 @@ int cipso_v4_req_setattr(struct request_sock *req,
buf = NULL;
req_inet = inet_rsk(req);
- opt = xchg((__force struct ip_options_rcu **)&req_inet->ireq_opt, opt);
+ opt = unrcu_pointer(xchg(&req_inet->ireq_opt, RCU_INITIALIZER(opt)));
if (opt)
kfree_rcu(opt, rcu);