summaryrefslogtreecommitdiff
path: root/include/net/inet_common.h
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2020-05-08 20:46:10 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2020-05-09 01:48:20 +0300
commitcb0721c7e200750907bb8ef59b12646a5cb2dadf (patch)
tree3c93173356e40ed0144c918bd845c2a50ee4ab4c /include/net/inet_common.h
parent488a23b89d175cc78f352417114f4f5a10470722 (diff)
downloadlinux-cb0721c7e200750907bb8ef59b12646a5cb2dadf.tar.xz
net: Refactor arguments of inet{,6}_bind
The intent is to add an additional bind parameter in the next commit. Instead of adding another argument, let's convert all existing flag arguments into an extendable bit field. No functional changes. Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Andrey Ignatov <rdna@fb.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20200508174611.228805-4-sdf@google.com
Diffstat (limited to 'include/net/inet_common.h')
-rw-r--r--include/net/inet_common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index ae2ba897675c..c38f4f7d660a 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -35,8 +35,12 @@ int inet_shutdown(struct socket *sock, int how);
int inet_listen(struct socket *sock, int backlog);
void inet_sock_destruct(struct sock *sk);
int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
+/* Don't allocate port at this moment, defer to connect. */
+#define BIND_FORCE_ADDRESS_NO_PORT (1 << 0)
+/* Grab and release socket lock. */
+#define BIND_WITH_LOCK (1 << 1)
int __inet_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len,
- bool force_bind_address_no_port, bool with_lock);
+ u32 flags);
int inet_getname(struct socket *sock, struct sockaddr *uaddr,
int peer);
int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);