summaryrefslogtreecommitdiffstats
path: root/net/mptcp/sockopt.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-08-16 10:15:37 +0200
committerDavid S. Miller <davem@davemloft.net>2023-08-16 12:09:17 +0200
commit3f7e753206bb20fc098b44ec40001befd1fe18d1 (patch)
tree2dbbbbfceaea1fc24ad2d095debef470312e3f2a /net/mptcp/sockopt.c
parentinet: move inet->recverr_rfc4884 to inet->inet_flags (diff)
downloadlinux-3f7e753206bb20fc098b44ec40001befd1fe18d1.tar.xz
linux-3f7e753206bb20fc098b44ec40001befd1fe18d1.zip
inet: move inet->freebind to inet->inet_flags
IP_FREEBIND socket option can now be set/read without locking the socket. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/sockopt.c')
-rw-r--r--net/mptcp/sockopt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 21bc46acbe38..ffbe2f5f5b44 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -419,7 +419,8 @@ static int mptcp_setsockopt_v6(struct mptcp_sock *msk, int optname,
inet_sk(sk)->transparent = inet_sk(ssk)->transparent;
break;
case IPV6_FREEBIND:
- inet_sk(sk)->freebind = inet_sk(ssk)->freebind;
+ inet_assign_bit(FREEBIND, sk,
+ inet_test_bit(FREEBIND, ssk));
break;
}
@@ -704,7 +705,7 @@ static int mptcp_setsockopt_sol_ip_set_transparent(struct mptcp_sock *msk, int o
switch (optname) {
case IP_FREEBIND:
- issk->freebind = inet_sk(sk)->freebind;
+ inet_assign_bit(FREEBIND, ssk, inet_test_bit(FREEBIND, sk));
break;
case IP_TRANSPARENT:
issk->transparent = inet_sk(sk)->transparent;
@@ -1441,7 +1442,7 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
__tcp_sock_set_nodelay(ssk, !!msk->nodelay);
inet_sk(ssk)->transparent = inet_sk(sk)->transparent;
- inet_sk(ssk)->freebind = inet_sk(sk)->freebind;
+ inet_assign_bit(FREEBIND, ssk, inet_test_bit(FREEBIND, sk));
}
static void __mptcp_sockopt_sync(struct mptcp_sock *msk, struct sock *ssk)