svn commit: r336797 - projects/pnfs-planb-server/usr.sbin/nfsd
Rick Macklem
rmacklem at FreeBSD.org
Fri Jul 27 23:34:12 UTC 2018
Author: rmacklem
Date: Fri Jul 27 23:34:10 2018
New Revision: 336797
URL: https://svnweb.freebsd.org/changeset/base/336797
Log:
When parsing the "-p" option for nfsd, only use an IPv6 link local address
if it is the only address.
Link local addresses that are passed from the MDS to a pNFS client for a DS
will only work if they are in the same scope zone and the address is
unambiguous for the client.
Modified:
projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.8
projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c
Modified: projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.8
==============================================================================
--- projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.8 Fri Jul 27 23:28:35 2018 (r336796)
+++ projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.8 Fri Jul 27 23:34:10 2018 (r336797)
@@ -28,7 +28,7 @@
.\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95
.\" $FreeBSD$
.\"
-.Dd June 30, 2018
+.Dd July 27, 2018
.Dt NFSD 8
.Os
.Sh NAME
@@ -156,6 +156,18 @@ data files for
and nfsv4-data1 will be used to store data files for
.Dq /export2 .
.El
+.sp
+When using IPv6 addresses for DSs
+be wary of using link local addresses.
+The IPv6 address for the DS is sent to the client and there is no scope
+zone in it.
+As such, a link local address may not work for a pNFS client to DS
+TCP connection.
+When parsed,
+.Nm
+will only use a link local address if it is the only address returned by
+.Xr getaddrinfo 3
+for the DS hostname.
.It Fl m Ar mirror_level
This option is only meaningful when used with the
.Fl p
Modified: projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c
==============================================================================
--- projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c Fri Jul 27 23:28:35 2018 (r336796)
+++ projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c Fri Jul 27 23:34:10 2018 (r336797)
@@ -1309,7 +1309,17 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd
memcpy(&sin6, res->ai_addr, sizeof(sin6));
ad = inet_ntop(AF_INET6, &sin6.sin6_addr, ip6,
sizeof(ip6));
- break;
+
+ /*
+ * XXX
+ * Since a link local address will only
+ * work if the client and DS are in the
+ * same scope zone, only use it if it is
+ * the only address.
+ */
+ if (ad != NULL &&
+ !IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr))
+ break;
}
}
if (ad == NULL)
More information about the svn-src-projects
mailing list