diff mbox series

[03/29] lnet: allow lnet_connect() to use IPv6 addresses

Message ID 1619381316-7719-4-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: Update to OpenSFS tree as of April 25, 2020 | expand

Commit Message

James Simmons April 25, 2021, 8:08 p.m. UTC
From: Mr NeilBrown <neilb@suse.de>

Now that we can created and bind IPv6 sockets, connecting to them is
trivial.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: fb40f0b62d77d69 ("LU-10391 lnet: allow lnet_connect() to use IPv6 addresses.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/37706
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/acceptor.c   | 3 ++-
 net/lnet/lnet/lib-socket.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/lnet/lnet/acceptor.c b/net/lnet/lnet/acceptor.c
index 5765a08..d326e39 100644
--- a/net/lnet/lnet/acceptor.c
+++ b/net/lnet/lnet/acceptor.c
@@ -140,7 +140,8 @@  struct socket *
 
 	BUILD_BUG_ON(sizeof(cr) > 16);		/* too big to be on the stack */
 
-	LASSERT(peeraddr->sa_family == AF_INET);
+	LASSERT(peeraddr->sa_family == AF_INET ||
+		peeraddr->sa_family == AF_INET6);
 
 	for (port = LNET_ACCEPTOR_MAX_RESERVED_PORT;
 	     port >= LNET_ACCEPTOR_MIN_RESERVED_PORT;
diff --git a/net/lnet/lnet/lib-socket.c b/net/lnet/lnet/lib-socket.c
index eb6559c..ee675ae 100644
--- a/net/lnet/lnet/lib-socket.c
+++ b/net/lnet/lnet/lib-socket.c
@@ -380,7 +380,7 @@  struct socket *
 	if (IS_ERR(sock))
 		return sock;
 
-	rc = kernel_connect(sock, peeraddr, sizeof(struct sockaddr_in), 0);
+	rc = kernel_connect(sock, peeraddr, sizeof(struct sockaddr_in6), 0);
 	if (!rc)
 		return sock;