summaryrefslogtreecommitdiff
path: root/net/ipv4/inet_diag.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-08-16 08:15:35 +0000
committerDavid S. Miller <davem@davemloft.net>2023-08-16 11:09:17 +0100
commit6b5f43ea08150e7ff72f734545101c58489ead5b (patch)
tree805b596ad9e4070ad6766a0e11b601d9a88edbac /net/ipv4/inet_diag.c
parentb4d84bce4c437c4ac1b6f7ef4d612d7d52f62cfe (diff)
inet: move inet->recverr to inet->inet_flags
IP_RECVERR socket option can now be set/get without locking the socket. This patch potentially avoid data-races around inet->recverr. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r--net/ipv4/inet_diag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index f7426926a104..25d5f76b66bd 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -182,7 +182,7 @@ int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
r->idiag_inode = sock_i_ino(sk);
memset(&inet_sockopt, 0, sizeof(inet_sockopt));
- inet_sockopt.recverr = inet->recverr;
+ inet_sockopt.recverr = inet_test_bit(RECVERR, sk);
inet_sockopt.is_icsk = inet->is_icsk;
inet_sockopt.freebind = inet->freebind;
inet_sockopt.hdrincl = inet->hdrincl;