Skip to contentSkip to conversation

rpc.nfsd: add no-ipv4 and no-ipv6 options

PATCH In review Kinglong Mee 5 participants 13 messages Jun 7, 2015 – Jun 9, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpc.nfsd: add no-ipv4 and no-ipv6 options

Sean reports running rpc.nfsd with --host options without IPv6 address. rpc.nfsd prints error message, but runs correctly for IPv4.
It is caused by that rpc.nfsd tries to bind IPv4 and IPv6 address default.

rpc.nfsd: unable to resolve nfs-server:nfs to inet6 address: Name or service not known

This patch add no-ipv4 and no-ipv6 options to disable ipv4/ipv6 directly.

---
 support/include/nfs/nfs.h |  8 ++++++++
 utils/nfsd/nfsd.c         | 27 ++++++++++++++++++++++++++-
 utils/nfsd/nfsd.man       | 10 ++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)
support/include/nfs/nfs.h +8 -0
index 27054e5..2be61f0 100644
@@ -47,19 +47,27 @@ struct nfs_fh_old {
 
 #define NFSCTL_UDPBIT		      (1 << (17 - 1))
 #define NFSCTL_TCPBIT		      (1 << (18 - 1))
+#define NFSCTL_INETBIT		      (1 << (19 - 1))
+#define NFSCTL_INET6BIT		      (1 << (20 - 1))
 
 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1))) 
 #define NFSCTL_UDPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_UDPBIT) 
 #define NFSCTL_TCPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_TCPBIT) 
+#define NFSCTL_INETUNSET(_cltbits)    ((_cltbits) &= ~NFSCTL_INETBIT)
+#define NFSCTL_INET6UNSET(_cltbits)   ((_cltbits) &= ~NFSCTL_INET6BIT)
 
 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1))) 
 #define NFSCTL_UDPISSET(_cltbits)     ((_cltbits) & NFSCTL_UDPBIT) 
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT) 
+#define NFSCTL_INETISSET(_cltbits)    ((_cltbits) & NFSCTL_INETBIT)
+#define NFSCTL_INET6ISSET(_cltbits)   ((_cltbits) & NFSCTL_INET6BIT)
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1))) 
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
 #define NFSCTL_TCPSET(_cltbits)       ((_cltbits) |= NFSCTL_TCPBIT)
+#define NFSCTL_INETSET(_cltbits)      ((_cltbits) |= NFSCTL_INETBIT)
+#define NFSCTL_INET6SET(_cltbits)     ((_cltbits) |= NFSCTL_INET6BIT)
 
 #define NFSCTL_ANYPROTO(_cltbits)     ((_cltbits) & (NFSCTL_UDPBIT | NFSCTL_TCPBIT))
 #define NFSCTL_ALLBITS (~0)
utils/nfsd/nfsd.c +26 -1
index 201bb13..4cd1ea8 100644
@@ -42,6 +42,8 @@ static struct option longopts[] =
 	{ "nfs-version", 1, 0, 'V' },
 	{ "no-tcp", 0, 0, 'T' },
 	{ "no-udp", 0, 0, 'U' },
+	{ "no-ipv4", 0, 0, 'F'},
+	{ "no-ipv6", 0, 0, 'S'},
 	{ "port", 1, 0, 'P' },
 	{ "port", 1, 0, 'p' },
 	{ "debug", 0, 0, 'd' },
@@ -135,7 +137,7 @@ main(int argc, char **argv)
 	xlog_syslog(0);
 	xlog_stderr(1);
 
-	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:FS", longopts, NULL)) != EOF) {
 		switch(c) {
 		case 'd':
 			xlog_config(D_ALL, 1);
@@ -238,6 +240,12 @@ main(int argc, char **argv)
 		case 'U':
 			NFSCTL_UDPUNSET(protobits);
 			break;
+		case 'F':
+			NFSCTL_INETUNSET(protobits);
+			break;
+		case 'S':
+			NFSCTL_INET6UNSET(protobits);
+			break;
 		case 'G':
 			grace = strtol(optarg, &p, 0);
 			if (*p || grace <= 0) {
@@ -280,6 +288,16 @@ main(int argc, char **argv)
 
 	nfsd_enable_protos(&proto4, &proto6);
 
+	if (!NFSCTL_INETISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto4);
+		NFSCTL_UDPUNSET(proto4);
+	}
+
+	if (!NFSCTL_INET6ISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto6);
+		NFSCTL_UDPUNSET(proto6);
+	}
+
 	if (!NFSCTL_TCPISSET(protobits)) {
 		NFSCTL_TCPUNSET(proto4);
 		NFSCTL_TCPUNSET(proto6);
@@ -301,6 +319,12 @@ main(int argc, char **argv)
 		exit(1);
 	}
 
+	if (!NFSCTL_INETISSET(protobits) &&
+	    !NFSCTL_INET6ISSET(protobits)) {
+		xlog(L_ERROR, "no internet protocols specified");
+		exit(1);
+	}
+
 	if (NFSCTL_VERISSET(versbits, 4) &&
 	    !NFSCTL_TCPISSET(proto4) &&
 	    !NFSCTL_TCPISSET(proto6)) {
@@ -397,6 +421,7 @@ usage(const char *prog)
 		"%s [-d|--debug] [-H hostname] [-p|-P|--port port]\n"
 		"     [-N|--no-nfs-version version] [-V|--nfs-version version]\n"
 		"     [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [-r|--rdma=]\n"
+		"     [-F|--no-ipv4] [-S|--no-ipv6]\n"
 		"     [-G|--grace-time secs] [-L|--leasetime secs] nrservs\n",
 		prog);
 	exit(2);
utils/nfsd/nfsd.man +10 -0
index 3ba847e..795f766 100644
@@ -77,6 +77,16 @@ Disable
 .B rpc.nfsd
 from accepting UDP connections from clients.
 .TP
+.B \-F " or " \-\-no-ipv4
+Disable
+.B rpc.nfsd
+from accepting IPv4 connections from clients.
+.TP
+.B \-S " or " \-\-no-ipv6
+Disable
+.B rpc.nfsd
+from accepting IPv6 connections from clients.
+.TP
 .B \-V " or " \-\-nfs-version vers
 This option can be used to request that 
 .B rpc.nfsd
Signature · 1 line
2.4.2
#1 lore raw

Hi Kinglong-

Quoted 5 lines · Kinglong Mee

Sean reports running rpc.nfsd with --host options without IPv6 address. rpc.nfsd prints error message, but runs correctly for IPv4.
It is caused by that rpc.nfsd tries to bind IPv4 and IPv6 address default.

rpc.nfsd: unable to resolve nfs-server:nfs to inet6 address: Name or service not known

Why not just turn this message into a debugging message?

Quoted 133 lines

This patch add no-ipv4 and no-ipv6 options to disable ipv4/ipv6 directly.

---

support/include/nfs/nfs.h |  8 ++++++++
utils/nfsd/nfsd.c         | 27 ++++++++++++++++++++++++++-
utils/nfsd/nfsd.man       | 10 ++++++++++
3 files changed, 44 insertions(+), 1 deletion(-)
support/include/nfs/nfs.h +8 -0
index 27054e5..2be61f0 100644
@@ -47,19 +47,27 @@ struct nfs_fh_old {
 
 #define NFSCTL_UDPBIT		      (1 << (17 - 1))
 #define NFSCTL_TCPBIT		      (1 << (18 - 1))
+#define NFSCTL_INETBIT		      (1 << (19 - 1))
+#define NFSCTL_INET6BIT		      (1 << (20 - 1))
 
 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1))) 
 #define NFSCTL_UDPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_UDPBIT) 
 #define NFSCTL_TCPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_TCPBIT) 
+#define NFSCTL_INETUNSET(_cltbits)    ((_cltbits) &= ~NFSCTL_INETBIT)
+#define NFSCTL_INET6UNSET(_cltbits)   ((_cltbits) &= ~NFSCTL_INET6BIT)
 
 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1))) 
 #define NFSCTL_UDPISSET(_cltbits)     ((_cltbits) & NFSCTL_UDPBIT) 
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT) 
+#define NFSCTL_INETISSET(_cltbits)    ((_cltbits) & NFSCTL_INETBIT)
+#define NFSCTL_INET6ISSET(_cltbits)   ((_cltbits) & NFSCTL_INET6BIT)
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1))) 
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
 #define NFSCTL_TCPSET(_cltbits)       ((_cltbits) |= NFSCTL_TCPBIT)
+#define NFSCTL_INETSET(_cltbits)      ((_cltbits) |= NFSCTL_INETBIT)
+#define NFSCTL_INET6SET(_cltbits)     ((_cltbits) |= NFSCTL_INET6BIT)
 
 #define NFSCTL_ANYPROTO(_cltbits)     ((_cltbits) & (NFSCTL_UDPBIT | NFSCTL_TCPBIT))
 #define NFSCTL_ALLBITS (~0)
utils/nfsd/nfsd.c +26 -1
index 201bb13..4cd1ea8 100644
@@ -42,6 +42,8 @@ static struct option longopts[] =
 	{ "nfs-version", 1, 0, 'V' },
 	{ "no-tcp", 0, 0, 'T' },
 	{ "no-udp", 0, 0, 'U' },
+	{ "no-ipv4", 0, 0, 'F'},
+	{ "no-ipv6", 0, 0, 'S'},
 	{ "port", 1, 0, 'P' },
 	{ "port", 1, 0, 'p' },
 	{ "debug", 0, 0, 'd' },
@@ -135,7 +137,7 @@ main(int argc, char **argv)
 	xlog_syslog(0);
 	xlog_stderr(1);
 
-	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:FS", longopts, NULL)) != EOF) {
 		switch(c) {
 		case 'd':
 			xlog_config(D_ALL, 1);
@@ -238,6 +240,12 @@ main(int argc, char **argv)
 		case 'U':
 			NFSCTL_UDPUNSET(protobits);
 			break;
+		case 'F':
+			NFSCTL_INETUNSET(protobits);
+			break;
+		case 'S':
+			NFSCTL_INET6UNSET(protobits);
+			break;
 		case 'G':
 			grace = strtol(optarg, &p, 0);
 			if (*p || grace <= 0) {
@@ -280,6 +288,16 @@ main(int argc, char **argv)
 
 	nfsd_enable_protos(&proto4, &proto6);
 
+	if (!NFSCTL_INETISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto4);
+		NFSCTL_UDPUNSET(proto4);
+	}
+
+	if (!NFSCTL_INET6ISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto6);
+		NFSCTL_UDPUNSET(proto6);
+	}
+
 	if (!NFSCTL_TCPISSET(protobits)) {
 		NFSCTL_TCPUNSET(proto4);
 		NFSCTL_TCPUNSET(proto6);
@@ -301,6 +319,12 @@ main(int argc, char **argv)
 		exit(1);
 	}
 
+	if (!NFSCTL_INETISSET(protobits) &&
+	    !NFSCTL_INET6ISSET(protobits)) {
+		xlog(L_ERROR, "no internet protocols specified");
+		exit(1);
+	}
+
 	if (NFSCTL_VERISSET(versbits, 4) &&
 	    !NFSCTL_TCPISSET(proto4) &&
 	    !NFSCTL_TCPISSET(proto6)) {
@@ -397,6 +421,7 @@ usage(const char *prog)
 		"%s [-d|--debug] [-H hostname] [-p|-P|--port port]\n"
 		"     [-N|--no-nfs-version version] [-V|--nfs-version version]\n"
 		"     [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [-r|--rdma=]\n"
+		"     [-F|--no-ipv4] [-S|--no-ipv6]\n"
 		"     [-G|--grace-time secs] [-L|--leasetime secs] nrservs\n",
 		prog);
 	exit(2);
utils/nfsd/nfsd.man +0 -0
index 3ba847e..795f766 100644
@@ -77,6 +77,16 @@ Disable

.B rpc.nfsd
from accepting UDP connections from clients.
.TP
+.B \-F " or " \-\-no-ipv4

utils/nfsd/nfsd.man +9 -0
+Disable
+.B rpc.nfsd
+from accepting IPv4 connections from clients.
+.TP
+.B \-S " or " \-\-no-ipv6
+Disable
+.B rpc.nfsd
+from accepting IPv6 connections from clients.
+.TP
Quoted 10 lines

.B \-V " or " \-\-nfs-version vers
This option can be used to request that
.B rpc.nfsd

Signature · 6 lines
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

#2 lore raw
Quoted 11 lines · Chuck Lever

Hi Kinglong-

Quoted 5 lines · Kinglong Mee

Sean reports running rpc.nfsd with --host options without IPv6 address. rpc.nfsd prints error message, but runs correctly for IPv4.
It is caused by that rpc.nfsd tries to bind IPv4 and IPv6 address default.

rpc.nfsd: unable to resolve nfs-server:nfs to inet6 address: Name or service not known

Why not just turn this message into a debugging message?

I think it's an important message for user, especially meeting error both, we should not remove it.

Also, it's a useful feature of turning off ipv4 or ipv6 for some case.

thanks,
Kinglong Mee

Quoted 152 lines
Quoted 134 lines

This patch add no-ipv4 and no-ipv6 options to disable ipv4/ipv6 directly.

---

support/include/nfs/nfs.h |  8 ++++++++
utils/nfsd/nfsd.c         | 27 ++++++++++++++++++++++++++-
utils/nfsd/nfsd.man       | 10 ++++++++++
3 files changed, 44 insertions(+), 1 deletion(-)
support/include/nfs/nfs.h +8 -0
index 27054e5..2be61f0 100644
@@ -47,19 +47,27 @@ struct nfs_fh_old {
 
 #define NFSCTL_UDPBIT		      (1 << (17 - 1))
 #define NFSCTL_TCPBIT		      (1 << (18 - 1))
+#define NFSCTL_INETBIT		      (1 << (19 - 1))
+#define NFSCTL_INET6BIT		      (1 << (20 - 1))
 
 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1))) 
 #define NFSCTL_UDPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_UDPBIT) 
 #define NFSCTL_TCPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_TCPBIT) 
+#define NFSCTL_INETUNSET(_cltbits)    ((_cltbits) &= ~NFSCTL_INETBIT)
+#define NFSCTL_INET6UNSET(_cltbits)   ((_cltbits) &= ~NFSCTL_INET6BIT)
 
 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1))) 
 #define NFSCTL_UDPISSET(_cltbits)     ((_cltbits) & NFSCTL_UDPBIT) 
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT) 
+#define NFSCTL_INETISSET(_cltbits)    ((_cltbits) & NFSCTL_INETBIT)
+#define NFSCTL_INET6ISSET(_cltbits)   ((_cltbits) & NFSCTL_INET6BIT)
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1))) 
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
 #define NFSCTL_TCPSET(_cltbits)       ((_cltbits) |= NFSCTL_TCPBIT)
+#define NFSCTL_INETSET(_cltbits)      ((_cltbits) |= NFSCTL_INETBIT)
+#define NFSCTL_INET6SET(_cltbits)     ((_cltbits) |= NFSCTL_INET6BIT)
 
 #define NFSCTL_ANYPROTO(_cltbits)     ((_cltbits) & (NFSCTL_UDPBIT | NFSCTL_TCPBIT))
 #define NFSCTL_ALLBITS (~0)
utils/nfsd/nfsd.c +26 -1
index 201bb13..4cd1ea8 100644
@@ -42,6 +42,8 @@ static struct option longopts[] =
 	{ "nfs-version", 1, 0, 'V' },
 	{ "no-tcp", 0, 0, 'T' },
 	{ "no-udp", 0, 0, 'U' },
+	{ "no-ipv4", 0, 0, 'F'},
+	{ "no-ipv6", 0, 0, 'S'},
 	{ "port", 1, 0, 'P' },
 	{ "port", 1, 0, 'p' },
 	{ "debug", 0, 0, 'd' },
@@ -135,7 +137,7 @@ main(int argc, char **argv)
 	xlog_syslog(0);
 	xlog_stderr(1);
 
-	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:FS", longopts, NULL)) != EOF) {
 		switch(c) {
 		case 'd':
 			xlog_config(D_ALL, 1);
@@ -238,6 +240,12 @@ main(int argc, char **argv)
 		case 'U':
 			NFSCTL_UDPUNSET(protobits);
 			break;
+		case 'F':
+			NFSCTL_INETUNSET(protobits);
+			break;
+		case 'S':
+			NFSCTL_INET6UNSET(protobits);
+			break;
 		case 'G':
 			grace = strtol(optarg, &p, 0);
 			if (*p || grace <= 0) {
@@ -280,6 +288,16 @@ main(int argc, char **argv)
 
 	nfsd_enable_protos(&proto4, &proto6);
 
+	if (!NFSCTL_INETISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto4);
+		NFSCTL_UDPUNSET(proto4);
+	}
+
+	if (!NFSCTL_INET6ISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto6);
+		NFSCTL_UDPUNSET(proto6);
+	}
+
 	if (!NFSCTL_TCPISSET(protobits)) {
 		NFSCTL_TCPUNSET(proto4);
 		NFSCTL_TCPUNSET(proto6);
@@ -301,6 +319,12 @@ main(int argc, char **argv)
 		exit(1);
 	}
 
+	if (!NFSCTL_INETISSET(protobits) &&
+	    !NFSCTL_INET6ISSET(protobits)) {
+		xlog(L_ERROR, "no internet protocols specified");
+		exit(1);
+	}
+
 	if (NFSCTL_VERISSET(versbits, 4) &&
 	    !NFSCTL_TCPISSET(proto4) &&
 	    !NFSCTL_TCPISSET(proto6)) {
@@ -397,6 +421,7 @@ usage(const char *prog)
 		"%s [-d|--debug] [-H hostname] [-p|-P|--port port]\n"
 		"     [-N|--no-nfs-version version] [-V|--nfs-version version]\n"
 		"     [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [-r|--rdma=]\n"
+		"     [-F|--no-ipv4] [-S|--no-ipv6]\n"
 		"     [-G|--grace-time secs] [-L|--leasetime secs] nrservs\n",
 		prog);
 	exit(2);
utils/nfsd/nfsd.man +0 -0
index 3ba847e..795f766 100644
@@ -77,6 +77,16 @@ Disable

.B rpc.nfsd
from accepting UDP connections from clients.
.TP
+.B \-F " or " \-\-no-ipv4

utils/nfsd/nfsd.man +9 -0
+Disable
+.B rpc.nfsd
+from accepting IPv4 connections from clients.
+.TP
+.B \-S " or " \-\-no-ipv6
+Disable
+.B rpc.nfsd
+from accepting IPv6 connections from clients.
+.TP
Quoted 10 lines

.B \-V " or " \-\-nfs-version vers
This option can be used to request that
.B rpc.nfsd

Signature · 6 lines
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

#3 lore raw
Quoted 9 lines · Kinglong Mee
Quoted 8 lines · Chuck Lever

Hi Kinglong-

Quoted 4 lines · Kinglong Mee

Sean reports running rpc.nfsd with --host options without IPv6 address. rpc.nfsd prints error message, but runs correctly for IPv4.
It is caused by that rpc.nfsd tries to bind IPv4 and IPv6 address default.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

rpc.nfsd: unable to resolve nfs-server:nfs to inet6 address: Name or service not known

Why not just turn this message into a debugging message?

I think it's an important message for user, especially meeting error both, we should not remove it.

Also, it's a useful feature of turning off ipv4 or ipv6 for some case.

Thanks for the patch Kinglong!

From my perspective as a user/admin, I welcome the option to turn off either IPv4 or IPv6 selectively. I could also see the sense in making it a debug level message, in that if it's not working as intended, you're going to inevitably put it into debug mode. And, as it stands, I think more people see the message now (on account of it being displayed when a host cannot be resolved to both an IPv4 and IPv6 address) than those who would need to see the error, but that's sheer conjecture on my part.

In any case, the patch is much appreciated, and I believe the functionality is worth it, regardless of what is done with the message itself.

Quoted 165 lines

thanks,
Kinglong Mee

Quoted 145 lines
Quoted 145 lines

This patch add no-ipv4 and no-ipv6 options to disable ipv4/ipv6 directly.

---

support/include/nfs/nfs.h |  8 ++++++++
utils/nfsd/nfsd.c         | 27 ++++++++++++++++++++++++++-
utils/nfsd/nfsd.man       | 10 ++++++++++
3 files changed, 44 insertions(+), 1 deletion(-)
support/include/nfs/nfs.h +8 -0
index 27054e5..2be61f0 100644
@@ -47,19 +47,27 @@ struct nfs_fh_old {
 
 #define NFSCTL_UDPBIT		      (1 << (17 - 1))
 #define NFSCTL_TCPBIT		      (1 << (18 - 1))
+#define NFSCTL_INETBIT		      (1 << (19 - 1))
+#define NFSCTL_INET6BIT		      (1 << (20 - 1))
 
 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1)))
 #define NFSCTL_UDPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_UDPBIT)
 #define NFSCTL_TCPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_TCPBIT)
+#define NFSCTL_INETUNSET(_cltbits)    ((_cltbits) &= 
 ~NFSCTL_INETBIT)
+#define NFSCTL_INET6UNSET(_cltbits)   ((_cltbits) &= 
 ~NFSCTL_INET6BIT)
 
 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1)))
 #define NFSCTL_UDPISSET(_cltbits)     ((_cltbits) & NFSCTL_UDPBIT)
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT)
+#define NFSCTL_INETISSET(_cltbits)    ((_cltbits) & NFSCTL_INETBIT)
+#define NFSCTL_INET6ISSET(_cltbits)   ((_cltbits) & NFSCTL_INET6BIT)
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1)))
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
 #define NFSCTL_TCPSET(_cltbits)       ((_cltbits) |= NFSCTL_TCPBIT)
+#define NFSCTL_INETSET(_cltbits)      ((_cltbits) |= NFSCTL_INETBIT)
+#define NFSCTL_INET6SET(_cltbits)     ((_cltbits) |= 
 NFSCTL_INET6BIT)

#define NFSCTL_ANYPROTO(_cltbits) ((_cltbits) & (NFSCTL_UDPBIT | NFSCTL_TCPBIT))
#define NFSCTL_ALLBITS (~0)

utils/nfsd/nfsd.c +3 -1
index 201bb13..4cd1ea8 100644
@@ -42,6 +42,8 @@ static struct option longopts[] =
 	{ "nfs-version", 1, 0, 'V' },
 	{ "no-tcp", 0, 0, 'T' },
 	{ "no-udp", 0, 0, 'U' },
+	{ "no-ipv4", 0, 0, 'F'},
+	{ "no-ipv6", 0, 0, 'S'},
 	{ "port", 1, 0, 'P' },
 	{ "port", 1, 0, 'p' },
 	{ "debug", 0, 0, 'd' },
@@ -135,7 +137,7 @@ main(int argc, char **argv)
 	xlog_syslog(0);
 	xlog_stderr(1);
 
-	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:", 
 longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:FS", 
 longopts, NULL)) != EOF) {
 		switch(c) {
		case 'd':
			xlog_config(D_ALL, 1);
utils/nfsd/nfsd.c +23 -0
@@ -238,6 +240,12 @@ main(int argc, char **argv)
 		case 'U':
 			NFSCTL_UDPUNSET(protobits);
 			break;
+		case 'F':
+			NFSCTL_INETUNSET(protobits);
+			break;
+		case 'S':
+			NFSCTL_INET6UNSET(protobits);
+			break;
 		case 'G':
 			grace = strtol(optarg, &p, 0);
 			if (*p || grace <= 0) {
@@ -280,6 +288,16 @@ main(int argc, char **argv)
 
 	nfsd_enable_protos(&proto4, &proto6);
 
+	if (!NFSCTL_INETISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto4);
+		NFSCTL_UDPUNSET(proto4);
+	}
+
+	if (!NFSCTL_INET6ISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto6);
+		NFSCTL_UDPUNSET(proto6);
+	}
+
 	if (!NFSCTL_TCPISSET(protobits)) {
 		NFSCTL_TCPUNSET(proto4);
 		NFSCTL_TCPUNSET(proto6);
@@ -301,6 +319,12 @@ main(int argc, char **argv)
 		exit(1);
 	}
 
+	if (!NFSCTL_INETISSET(protobits) &&
+	    !NFSCTL_INET6ISSET(protobits)) {
+		xlog(L_ERROR, "no internet protocols specified");
+		exit(1);
+	}
+
 	if (NFSCTL_VERISSET(versbits, 4) &&
 	    !NFSCTL_TCPISSET(proto4) &&
 	    !NFSCTL_TCPISSET(proto6)) {
@@ -397,6 +421,7 @@ usage(const char *prog)
 		"%s [-d|--debug] [-H hostname] [-p|-P|--port port]\n"
 		"     [-N|--no-nfs-version version] [-V|--nfs-version version]\n"
 		"     [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [-r|--rdma=]\n"
+		"     [-F|--no-ipv4] [-S|--no-ipv6]\n"
 		"     [-G|--grace-time secs] [-L|--leasetime secs] nrservs\n",
 		prog);
 	exit(2);
utils/nfsd/nfsd.man +0 -0
index 3ba847e..795f766 100644
@@ -77,6 +77,16 @@ Disable

.B rpc.nfsd
from accepting UDP connections from clients.
.TP
+.B \-F " or " \-\-no-ipv4

utils/nfsd/nfsd.man +9 -0
+Disable
+.B rpc.nfsd
+from accepting IPv4 connections from clients.
+.TP
+.B \-S " or " \-\-no-ipv6
+Disable
+.B rpc.nfsd
+from accepting IPv6 connections from clients.
+.TP

.B \-V " or " \-\-nfs-version vers
This option can be used to request that
.B rpc.nfsd
--
2.4.2

Quoted 12 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 13 lines · Sean Elble
Quoted 11 lines · Kinglong Mee
Quoted 7 lines · Chuck Lever

Hi Kinglong-

Quoted 4 lines · Kinglong Mee

Sean reports running rpc.nfsd with --host options without IPv6 address. rpc.nfsd prints error message, but runs correctly for IPv4.
It is caused by that rpc.nfsd tries to bind IPv4 and IPv6 address default. rpc.nfsd: unable to resolve nfs-server:nfs to inet6 address: Name or service not known

Why not just turn this message into a debugging message?

I think it's an important message for user, especially meeting error both, we should not remove it.
Also, it's a useful feature of turning off ipv4 or ipv6 for some case.

Quoted 5 lines

Thanks for the patch Kinglong!

From my perspective as a user/admin, I welcome the option to turn off either IPv4 or IPv6 selectively. I could also see the sense in making it a debug level message, in that if it's not working as intended, you're going to inevitably put it into debug mode. And, as it stands, I think more people see the message now (on account of it being displayed when a host cannot be resolved to both an IPv4 and IPv6 address) than those who would need to see the error, but that's sheer conjecture on my part.

In any case, the patch is much appreciated, and I believe the functionality is worth it, regardless of what is done with the message itself.

I don’t understand the need to “turn off” an address family. That’s what /etc/netconfig is supposed to be for. What’s not happening here that should be?

Quoted 136 lines
Quoted 136 lines

thanks,
Kinglong Mee

Quoted 134 lines
Quoted 123 lines

This patch add no-ipv4 and no-ipv6 options to disable ipv4/ipv6 directly.

---

support/include/nfs/nfs.h |  8 ++++++++
utils/nfsd/nfsd.c         | 27 ++++++++++++++++++++++++++-
utils/nfsd/nfsd.man       | 10 ++++++++++
3 files changed, 44 insertions(+), 1 deletion(-)
support/include/nfs/nfs.h +8 -0
index 27054e5..2be61f0 100644
@@ -47,19 +47,27 @@ struct nfs_fh_old {
 #define NFSCTL_UDPBIT		      (1 << (17 - 1))
 #define NFSCTL_TCPBIT		      (1 << (18 - 1))
+#define NFSCTL_INETBIT		      (1 << (19 - 1))
+#define NFSCTL_INET6BIT		      (1 << (20 - 1))
 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1)))
 #define NFSCTL_UDPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_UDPBIT)
 #define NFSCTL_TCPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_TCPBIT)
+#define NFSCTL_INETUNSET(_cltbits)    ((_cltbits) &= ~NFSCTL_INETBIT)
+#define NFSCTL_INET6UNSET(_cltbits)   ((_cltbits) &= ~NFSCTL_INET6BIT)
 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1)))
 #define NFSCTL_UDPISSET(_cltbits)     ((_cltbits) & NFSCTL_UDPBIT)
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT)
+#define NFSCTL_INETISSET(_cltbits)    ((_cltbits) & NFSCTL_INETBIT)
+#define NFSCTL_INET6ISSET(_cltbits)   ((_cltbits) & NFSCTL_INET6BIT)
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1)))
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
 #define NFSCTL_TCPSET(_cltbits)       ((_cltbits) |= NFSCTL_TCPBIT)
+#define NFSCTL_INETSET(_cltbits)      ((_cltbits) |= NFSCTL_INETBIT)
+#define NFSCTL_INET6SET(_cltbits)     ((_cltbits) |= NFSCTL_INET6BIT)
 #define NFSCTL_ANYPROTO(_cltbits)     ((_cltbits) & (NFSCTL_UDPBIT | NFSCTL_TCPBIT))
 #define NFSCTL_ALLBITS (~0)
utils/nfsd/nfsd.c +26 -1
index 201bb13..4cd1ea8 100644
@@ -42,6 +42,8 @@ static struct option longopts[] =
 	{ "nfs-version", 1, 0, 'V' },
 	{ "no-tcp", 0, 0, 'T' },
 	{ "no-udp", 0, 0, 'U' },
+	{ "no-ipv4", 0, 0, 'F'},
+	{ "no-ipv6", 0, 0, 'S'},
 	{ "port", 1, 0, 'P' },
 	{ "port", 1, 0, 'p' },
 	{ "debug", 0, 0, 'd' },
@@ -135,7 +137,7 @@ main(int argc, char **argv)
 	xlog_syslog(0);
 	xlog_stderr(1);
-	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:FS", longopts, NULL)) != EOF) {
 		switch(c) {
 		case 'd':
 			xlog_config(D_ALL, 1);
@@ -238,6 +240,12 @@ main(int argc, char **argv)
 		case 'U':
 			NFSCTL_UDPUNSET(protobits);
 			break;
+		case 'F':
+			NFSCTL_INETUNSET(protobits);
+			break;
+		case 'S':
+			NFSCTL_INET6UNSET(protobits);
+			break;
 		case 'G':
 			grace = strtol(optarg, &p, 0);
 			if (*p || grace <= 0) {
@@ -280,6 +288,16 @@ main(int argc, char **argv)
 	nfsd_enable_protos(&proto4, &proto6);
+	if (!NFSCTL_INETISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto4);
+		NFSCTL_UDPUNSET(proto4);
+	}
+
+	if (!NFSCTL_INET6ISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto6);
+		NFSCTL_UDPUNSET(proto6);
+	}
+
 	if (!NFSCTL_TCPISSET(protobits)) {
 		NFSCTL_TCPUNSET(proto4);
 		NFSCTL_TCPUNSET(proto6);
@@ -301,6 +319,12 @@ main(int argc, char **argv)
 		exit(1);
 	}
+	if (!NFSCTL_INETISSET(protobits) &&
+	    !NFSCTL_INET6ISSET(protobits)) {
+		xlog(L_ERROR, "no internet protocols specified");
+		exit(1);
+	}
+
 	if (NFSCTL_VERISSET(versbits, 4) &&
 	    !NFSCTL_TCPISSET(proto4) &&
 	    !NFSCTL_TCPISSET(proto6)) {
@@ -397,6 +421,7 @@ usage(const char *prog)
 		"%s [-d|--debug] [-H hostname] [-p|-P|--port port]\n"
 		"     [-N|--no-nfs-version version] [-V|--nfs-version version]\n"
 		"     [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [-r|--rdma=]\n"
+		"     [-F|--no-ipv4] [-S|--no-ipv6]\n"
 		"     [-G|--grace-time secs] [-L|--leasetime secs] nrservs\n",
 		prog);
 	exit(2);
utils/nfsd/nfsd.man +0 -0
index 3ba847e..795f766 100644
@@ -77,6 +77,16 @@ Disable

.B rpc.nfsd
from accepting UDP connections from clients.
.TP
+.B \-F " or " \-\-no-ipv4

utils/nfsd/nfsd.man +9 -0
+Disable
+.B rpc.nfsd
+from accepting IPv4 connections from clients.
+.TP
+.B \-S " or " \-\-no-ipv6
+Disable
+.B rpc.nfsd
+from accepting IPv6 connections from clients.
+.TP

.B \-V " or " \-\-nfs-version vers

Quoted 8 lines

This option can be used to request that
.B rpc.nfsd
--
2.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

Quoted 8 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
[email protected]

#5 lore raw
Quoted 18 lines · Chuck Lever
Quoted 15 lines · Sean Elble
Quoted 11 lines · Kinglong Mee
Quoted 7 lines · Chuck Lever

Hi Kinglong-

Quoted 4 lines · Kinglong Mee

Sean reports running rpc.nfsd with --host options without IPv6 address. rpc.nfsd prints error message, but runs correctly for IPv4.
It is caused by that rpc.nfsd tries to bind IPv4 and IPv6 address default. rpc.nfsd: unable to resolve nfs-server:nfs to inet6 address: Name or service not known

Why not just turn this message into a debugging message?

I think it's an important message for user, especially meeting error both, we should not remove it.
Also, it's a useful feature of turning off ipv4 or ipv6 for some case.

Thanks for the patch Kinglong!

Quoted 7 lines
Quoted 3 lines

From my perspective as a user/admin, I welcome the option to turn off either IPv4 or IPv6 selectively. I could also see the sense in making it a debug level message, in that if it's not working as intended, you're going to inevitably put it into debug mode. And, as it stands, I think more people see the message now (on account of it being displayed when a host cannot be resolved to both an IPv4 and IPv6 address) than those who would need to see the error, but that's sheer conjecture on my part.

In any case, the patch is much appreciated, and I believe the functionality is worth it, regardless of what is done with the message itself.

I don’t understand the need to “turn off” an address family. That’s what /etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for bears of little brain?

Quoted 142 lines
Quoted 142 lines
Quoted 142 lines

thanks,
Kinglong Mee

Quoted 126 lines
Quoted 126 lines

This patch add no-ipv4 and no-ipv6 options to disable ipv4/ipv6 directly.

---

support/include/nfs/nfs.h |  8 ++++++++
utils/nfsd/nfsd.c         | 27 ++++++++++++++++++++++++++-
utils/nfsd/nfsd.man       | 10 ++++++++++
3 files changed, 44 insertions(+), 1 deletion(-)
support/include/nfs/nfs.h +8 -0
index 27054e5..2be61f0 100644
@@ -47,19 +47,27 @@ struct nfs_fh_old {
 #define NFSCTL_UDPBIT		      (1 << (17 - 1))
 #define NFSCTL_TCPBIT		      (1 << (18 - 1))
+#define NFSCTL_INETBIT		      (1 << (19 - 1))
+#define NFSCTL_INET6BIT		      (1 << (20 - 1))
 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1)))
 #define NFSCTL_UDPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_UDPBIT)
 #define NFSCTL_TCPUNSET(_cltbits)     ((_cltbits) &= ~NFSCTL_TCPBIT)
+#define NFSCTL_INETUNSET(_cltbits)    ((_cltbits) &= ~NFSCTL_INETBIT)
+#define NFSCTL_INET6UNSET(_cltbits)   ((_cltbits) &= ~NFSCTL_INET6BIT)
 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1)))
 #define NFSCTL_UDPISSET(_cltbits)     ((_cltbits) & NFSCTL_UDPBIT)
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT)
+#define NFSCTL_INETISSET(_cltbits)    ((_cltbits) & NFSCTL_INETBIT)
+#define NFSCTL_INET6ISSET(_cltbits)   ((_cltbits) & NFSCTL_INET6BIT)
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1)))
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
 #define NFSCTL_TCPSET(_cltbits)       ((_cltbits) |= NFSCTL_TCPBIT)
+#define NFSCTL_INETSET(_cltbits)      ((_cltbits) |= NFSCTL_INETBIT)
+#define NFSCTL_INET6SET(_cltbits)     ((_cltbits) |= NFSCTL_INET6BIT)
 #define NFSCTL_ANYPROTO(_cltbits)     ((_cltbits) & (NFSCTL_UDPBIT | NFSCTL_TCPBIT))
 #define NFSCTL_ALLBITS (~0)
utils/nfsd/nfsd.c +26 -1
index 201bb13..4cd1ea8 100644
@@ -42,6 +42,8 @@ static struct option longopts[] =
 	{ "nfs-version", 1, 0, 'V' },
 	{ "no-tcp", 0, 0, 'T' },
 	{ "no-udp", 0, 0, 'U' },
+	{ "no-ipv4", 0, 0, 'F'},
+	{ "no-ipv6", 0, 0, 'S'},
 	{ "port", 1, 0, 'P' },
 	{ "port", 1, 0, 'p' },
 	{ "debug", 0, 0, 'd' },
@@ -135,7 +137,7 @@ main(int argc, char **argv)
 	xlog_syslog(0);
 	xlog_stderr(1);
-	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTUrG:L:FS", longopts, NULL)) != EOF) {
 		switch(c) {
 		case 'd':
 			xlog_config(D_ALL, 1);
@@ -238,6 +240,12 @@ main(int argc, char **argv)
 		case 'U':
 			NFSCTL_UDPUNSET(protobits);
 			break;
+		case 'F':
+			NFSCTL_INETUNSET(protobits);
+			break;
+		case 'S':
+			NFSCTL_INET6UNSET(protobits);
+			break;
 		case 'G':
 			grace = strtol(optarg, &p, 0);
 			if (*p || grace <= 0) {
@@ -280,6 +288,16 @@ main(int argc, char **argv)
 	nfsd_enable_protos(&proto4, &proto6);
+	if (!NFSCTL_INETISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto4);
+		NFSCTL_UDPUNSET(proto4);
+	}
+
+	if (!NFSCTL_INET6ISSET(protobits)) {
+		NFSCTL_TCPUNSET(proto6);
+		NFSCTL_UDPUNSET(proto6);
+	}
+
 	if (!NFSCTL_TCPISSET(protobits)) {
 		NFSCTL_TCPUNSET(proto4);
 		NFSCTL_TCPUNSET(proto6);
@@ -301,6 +319,12 @@ main(int argc, char **argv)
 		exit(1);
 	}
+	if (!NFSCTL_INETISSET(protobits) &&
+	    !NFSCTL_INET6ISSET(protobits)) {
+		xlog(L_ERROR, "no internet protocols specified");
+		exit(1);
+	}
+
 	if (NFSCTL_VERISSET(versbits, 4) &&
 	    !NFSCTL_TCPISSET(proto4) &&
 	    !NFSCTL_TCPISSET(proto6)) {
@@ -397,6 +421,7 @@ usage(const char *prog)
 		"%s [-d|--debug] [-H hostname] [-p|-P|--port port]\n"
 		"     [-N|--no-nfs-version version] [-V|--nfs-version version]\n"
 		"     [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [-r|--rdma=]\n"
+		"     [-F|--no-ipv4] [-S|--no-ipv6]\n"
 		"     [-G|--grace-time secs] [-L|--leasetime secs] nrservs\n",
 		prog);
 	exit(2);
utils/nfsd/nfsd.man +0 -0
index 3ba847e..795f766 100644
@@ -77,6 +77,16 @@ Disable

.B rpc.nfsd
from accepting UDP connections from clients.
.TP
+.B \-F " or " \-\-no-ipv4

utils/nfsd/nfsd.man +9 -0
+Disable
+.B rpc.nfsd
+from accepting IPv4 connections from clients.
+.TP
+.B \-S " or " \-\-no-ipv6
+Disable
+.B rpc.nfsd
+from accepting IPv6 connections from clients.
+.TP

.B \-V " or " \-\-nfs-version vers
This option can be used to request that
.B rpc.nfsd
--

Quoted 8 lines
Quoted 5 lines

2.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 11 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
[email protected]

--
Chuck Lever
[email protected]

#6 lore raw
Quoted 8 lines · Chuck Lever
Quoted 3 lines

I don’t understand the need to “turn off” an address family. That’s what /etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for bears of little brain?

Sure, and please correct me if any of my understanding is incorrect (as it may well be). In my environment, I wanted to have NFS only listen on one interface of a multihomed host. In using the "--host" parameter to do so, I saw the error message regarding IPv6 thrown. While disabling IPv6 globally in /etc/netconfig is an option (one I understand to be "global", in that it'd affect *all* applications on the host), it'd be nice to disable IPv6 for a single service/daemon instead.

Of course, the fact that at least Ubuntu and RHEL (and almost certainly their upstream and their derivatives, respectively) relay the error message when running the NFS init scripts could confuse someone into thinking NFS failed to start properly (until they look at the output of netstat -nalp, etc.). I'd almost argue that's a larger concern. By the same token, "--host" seems a little used option, for whatever reason.

In any case, I'm the little brained one in this group. :-)

-Sean

#7 lore raw
Quoted 10 lines · Sean Elble
Quoted 7 lines · Chuck Lever
Quoted 3 lines

I don’t understand the need to “turn off” an address family. That’s what /etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for bears of little brain?

Sure, and please correct me if any of my understanding is incorrect (as it may well be). In my environment, I wanted to have NFS only listen on one interface of a multihomed host. In using the "--host" parameter to do so, I saw the error message regarding IPv6 thrown.

OK, yes I read that last week, and had just forgotten it. That sounds to me like - - host is broken (or, at least noisier than it should be in this case).

Do you provide an IP address or a hostname when specifying - - host?

Quoted 5 lines

While disabling IPv6 globally in /etc/netconfig is an option (one I understand to be "global", in that it'd affect *all* applications on the host), it'd be nice to disable IPv6 for a single service/daemon instead.

Of course, the fact that at least Ubuntu and RHEL (and almost certainly their upstream and their derivatives, respectively) relay the error message when running the NFS init scripts could confuse someone into thinking NFS failed to start properly (until they look at the output of netstat -nalp, etc.). I'd almost argue that's a larger concern. By the same token, "--host" seems a little used option, for whatever reason.

In any case, I'm the little brained one in this group. :-)

--
Chuck Lever
[email protected]

#8 lore raw
Quoted 11 lines · Chuck Lever
Quoted 9 lines · Sean Elble
Quoted 7 lines · Chuck Lever
Quoted 3 lines

I don’t understand the need to “turn off” an address family. That’s what /etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for bears of little brain?

Quoted 5 lines
Quoted 1 line

Sure, and please correct me if any of my understanding is incorrect (as it may well be). In my environment, I wanted to have NFS only listen on one interface of a multihomed host. In using the "--host" parameter to do so, I saw the error message regarding IPv6 thrown.

OK, yes I read that last week, and had just forgotten it. That sounds to me like - - host is broken (or, at least noisier than it should be in this case).

Agreed. I guess it's just a matter of what the appropriate fix is.

Quoted 2 lines

Do you provide an IP address or a hostname when specifying - - host?

I've provided both hostname and IP address, with the same result, IIRC.

Quoted 17 lines
Quoted 6 lines

While disabling IPv6 globally in /etc/netconfig is an option (one I understand to be "global", in that it'd affect *all* applications on the host), it'd be nice to disable IPv6 for a single service/daemon instead.

Of course, the fact that at least Ubuntu and RHEL (and almost certainly their upstream and their derivatives, respectively) relay the error message when running the NFS init scripts could confuse someone into thinking NFS failed to start properly (until they look at the output of netstat -nalp, etc.). I'd almost argue that's a larger concern. By the same token, "--host" seems a little used option, for whatever reason.

In any case, I'm the little brained one in this group. :-)

--
Chuck Lever
[email protected]

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
In reply to Sean Elble
Quoted 12 lines · Sean Elble
Quoted 10 lines · Chuck Lever
Quoted 4 lines

I don’t understand the need to “turn off” an address family. That’s what
/etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for
bears of little brain?

Quoted 8 lines

Sure, and please correct me if any of my understanding is incorrect (as it may well be). In my environment, I wanted to have NFS only listen on one interface of a multihomed host. In using the "--host" parameter to do so, I saw the error message regarding IPv6 thrown. While disabling IPv6 globally in /etc/netconfig is an option (one I understand to be "global", in that it'd affect *all* applications on the host), it'd be nice to disable IPv6 for a single service/daemon instead.

But doesn't something like

	rpc.nfsd --host 10.0.0.1 --no-ipv6

seem a bit redundant?

I mean, you've already told it to listen to that one (ipv4) address. That'd argue for just disabling the warning in this case, I think. But my understanding of IPv6 is still poor.

--b.

#10 lore raw
Quoted 25 lines · J. Bruce Fields
Quoted 12 lines · Sean Elble
Quoted 10 lines · Chuck Lever
Quoted 4 lines

I don’t understand the need to “turn off” an address family. That’s what
/etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for
bears of little brain?

Quoted 8 lines

Sure, and please correct me if any of my understanding is incorrect (as it may well be). In my environment, I wanted to have NFS only listen on one interface of a multihomed host. In using the "--host" parameter to do so, I saw the error message regarding IPv6 thrown. While disabling IPv6 globally in /etc/netconfig is an option (one I understand to be "global", in that it'd affect *all* applications on the host), it'd be nice to disable IPv6 for a single service/daemon instead.

Quoted 5 lines

But doesn't something like

	rpc.nfsd --host 10.0.0.1 --no-ipv6

seem a bit redundant?

In that case, perhaps it does. But what if you were to use a hostname that resolved to both IPv4 and IPv6 addresses?

Quoted 4 lines

I mean, you've already told it to listen to that one (ipv4) address. That'd argue for just disabling the warning in this case, I think. But my understanding of IPv6 is still poor.

Yours and mine both. But until it gets better, I’m very comfortable in just turning it off in places where 1) I know it’s not needed and 2) Places where exploits could linger with most of our emphasis on IPv4 still.

Quoted 3 lines

--b.

#11 lore raw
Quoted 25 lines · Sean Elble
Quoted 25 lines · J. Bruce Fields
Quoted 20 lines · Sean Elble
Quoted 10 lines · Chuck Lever
Quoted 4 lines

I don’t understand the need to “turn off” an address family. That’s what
/etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for
bears of little brain?

Sure, and please correct me if any of my understanding is incorrect (as it may well be). In my environment, I wanted to have NFS only listen on one interface of a multihomed host. In using the "--host" parameter to do so, I saw the error message regarding IPv6 thrown. While disabling IPv6 globally in /etc/netconfig is an option (one I understand to be "global", in that it'd affect *all* applications on the host), it'd be nice to disable IPv6 for a single service/daemon instead.

Quoted 7 lines
Quoted 5 lines

But doesn't something like

	rpc.nfsd --host 10.0.0.1 --no-ipv6

seem a bit redundant?

In that case, perhaps it does. But what if you were to use a hostname that resolved to both IPv4 and IPv6 addresses?

I think the common expectation is that NFSD should present an IPv6 listener in that case.

If you give rpc.nfsd a hostname and it has no mapped IPv6 address, or you give rpc.nfsd an IPv4 address, then no IPv6 listener should be started.

Quoted 2 lines
Quoted 2 lines

I mean, you've already told it to listen to that one (ipv4) address. That'd argue for just disabling the warning in this case, I think.

I agree with that (either disabling it, or getting rid of the false negative).

Quoted 3 lines
Quoted 1 line

But my understanding of IPv6 is still poor.

Yours and mine both. But until it gets better, I’m very comfortable in just turning it off in places where 1) I know it’s not needed and 2) Places where exploits could linger with most of our emphasis on IPv4 still.

In the specific usage scenario you opened the thread with, you used a hostname with no IPv6 mapping, and you got exactly what you wanted:
only an IPv4 listener.

Seems like the rpc.nfsd command line interface is already rich enough to provide what you want?

--
Chuck Lever
[email protected]

#12 lore raw
Quoted 51 lines · Chuck Lever
Quoted 25 lines · Sean Elble
Quoted 25 lines · J. Bruce Fields
Quoted 20 lines · Sean Elble
Quoted 10 lines · Chuck Lever
Quoted 4 lines

I don’t understand the need to “turn off” an address family. That’s what
/etc/netconfig is supposed to be for. What’s not happening here that should be?

What I mean is: I’d rather not add more command line options if there is a way for rpc.nfsd to automatically and quietly do what is needed. But I don’t understand the use case here. Sean, can you explain it for
bears of little brain?

Sure, and please correct me if any of my understanding is incorrect (as it may well be). In my environment, I wanted to have NFS only listen on one interface of a multihomed host. In using the "--host" parameter to do so, I saw the error message regarding IPv6 thrown. While disabling IPv6 globally in /etc/netconfig is an option (one I understand to be "global", in that it'd affect *all* applications on the host), it'd be nice to disable IPv6 for a single service/daemon instead.

Quoted 7 lines
Quoted 5 lines

But doesn't something like

	rpc.nfsd --host 10.0.0.1 --no-ipv6

seem a bit redundant?

In that case, perhaps it does. But what if you were to use a hostname that resolved to both IPv4 and IPv6 addresses?

I think the common expectation is that NFSD should present an IPv6 listener in that case.

If you give rpc.nfsd a hostname and it has no mapped IPv6 address, or you give rpc.nfsd an IPv4 address, then no IPv6 listener should be started.

Quoted 2 lines
Quoted 2 lines

I mean, you've already told it to listen to that one (ipv4) address. That'd argue for just disabling the warning in this case, I think.

I agree with that (either disabling it, or getting rid of the false negative).

Quoted 2 lines
Quoted 1 line

But my understanding of IPv6 is still poor.

Quoted 8 lines
Quoted 1 line

Yours and mine both. But until it gets better, I’m very comfortable in just turning it off in places where 1) I know it’s not needed and 2) Places where exploits could linger with most of our emphasis on IPv4 still.

In the specific usage scenario you opened the thread with, you used a hostname with no IPv6 mapping, and you got exactly what you wanted:
only an IPv4 listener.

Seems like the rpc.nfsd command line interface is already rich enough to provide what you want?

Yeah. If somebody does need the --no-ipv4/6 stuff then we can add that in addition, but first let's just kill the warning, it sounds to me like that warning's just wrong.

--b.