diff options
author | Eric Dumazet <edumazet@google.com> | 2023-08-16 10:15:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-08-16 12:09:17 +0200 |
commit | 6b5f43ea08150e7ff72f734545101c58489ead5b (patch) | |
tree | 805b596ad9e4070ad6766a0e11b601d9a88edbac /net/sctp | |
parent | inet: set/get simple options locklessly (diff) | |
download | linux-6b5f43ea08150e7ff72f734545101c58489ead5b.tar.xz linux-6b5f43ea08150e7ff72f734545101c58489ead5b.zip |
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/sctp')
-rw-r--r-- | net/sctp/input.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 2613c4d74b16..17fcaa9b0df9 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -581,7 +581,7 @@ static void sctp_v4_err_handle(struct sctp_transport *t, struct sk_buff *skb, default: return; } - if (!sock_owned_by_user(sk) && inet_sk(sk)->recverr) { + if (!sock_owned_by_user(sk) && inet_test_bit(RECVERR, sk)) { sk->sk_err = err; sk_error_report(sk); } else { /* Only an error on timeout */ |