summaryrefslogtreecommitdiff
path: root/include/net/inet_sock.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-08-16 11:15:37 +0300
committerDavid S. Miller <davem@davemloft.net>2023-08-16 13:09:17 +0300
commit3f7e753206bb20fc098b44ec40001befd1fe18d1 (patch)
tree2dbbbbfceaea1fc24ad2d095debef470312e3f2a /include/net/inet_sock.h
parent8e8cfb114d9f1e2efddb892f993c1ad61635c85e (diff)
downloadlinux-3f7e753206bb20fc098b44ec40001befd1fe18d1.tar.xz
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 'include/net/inet_sock.h')
-rw-r--r--include/net/inet_sock.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index c01f1f64a861..d6ba963534b4 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -231,7 +231,6 @@ struct inet_sock {
__u8 mc_ttl;
__u8 pmtudisc;
__u8 is_icsk:1,
- freebind:1,
hdrincl:1,
mc_loop:1,
transparent:1,
@@ -271,6 +270,7 @@ enum {
INET_FLAGS_RECVERR = 9,
INET_FLAGS_RECVERR_RFC4884 = 10,
+ INET_FLAGS_FREEBIND = 11,
};
/* cmsg flags for inet */
@@ -423,7 +423,8 @@ static inline bool inet_can_nonlocal_bind(struct net *net,
struct inet_sock *inet)
{
return READ_ONCE(net->ipv4.sysctl_ip_nonlocal_bind) ||
- inet->freebind || inet->transparent;
+ test_bit(INET_FLAGS_FREEBIND, &inet->inet_flags) ||
+ inet->transparent;
}
static inline bool inet_addr_valid_or_nonlocal(struct net *net,