mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
inet: introduce inet->inet_flags
Various inet fields are currently racy. do_ip_setsockopt() and do_ip_getsockopt() are mostly holding the socket lock, but some (fast) paths do not. Use a new inet->inet_flags to hold atomic bits in the series. Remove inet->cmsg_flags, and use instead 9 bits from inet_flags. 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>
This commit is contained in:
parent
936db833c2
commit
c274af2242
8 changed files with 83 additions and 71 deletions
|
@ -552,7 +552,7 @@ static int l2tp_ip_recvmsg(struct sock *sk, struct msghdr *msg,
|
|||
memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
|
||||
*addr_len = sizeof(*sin);
|
||||
}
|
||||
if (inet->cmsg_flags)
|
||||
if (inet_cmsg_flags(inet))
|
||||
ip_cmsg_recv(msg, skb);
|
||||
if (flags & MSG_TRUNC)
|
||||
copied = skb->len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue