summaryrefslogtreecommitdiff
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-29 15:09:42 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-29 23:10:39 +0300
commitc0425a4249e9d313eec5f81c0bde8a286ebf9a63 (patch)
treedbe8e82ca86e471956cef038764adb299270b0ef /net/core/sock.c
parent05bfd3661448a46db3a258b316160d34cf0a1317 (diff)
downloadlinux-c0425a4249e9d313eec5f81c0bde8a286ebf9a63.tar.xz
net: add a new bind_add method
The SCTP protocol allows to bind multiple address to a socket. That feature is currently only exposed as a socket option. Add a bind_add method struct proto that allows to bind additional addresses, and switch the dlm code to use the method instead of going through the socket option from kernel space. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 2ca3425b519c..61ec573221a6 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3712,3 +3712,11 @@ bool sk_busy_loop_end(void *p, unsigned long start_time)
}
EXPORT_SYMBOL(sk_busy_loop_end);
#endif /* CONFIG_NET_RX_BUSY_POLL */
+
+int sock_bind_add(struct sock *sk, struct sockaddr *addr, int addr_len)
+{
+ if (!sk->sk_prot->bind_add)
+ return -EOPNOTSUPP;
+ return sk->sk_prot->bind_add(sk, addr, addr_len);
+}
+EXPORT_SYMBOL(sock_bind_add);