diff mbox

[03/10] nfsd: add /etc/nfs.conf support for nfsd.port option.

Message ID 148117124486.31271.2529245859270914389.stgit@noble (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown Dec. 8, 2016, 4:27 a.m. UTC
Signed-off-by: NeilBrown <neilb@suse.com>
---
 systemd/nfs.conf.man |    5 ++++-
 utils/nfsd/nfsd.c    |    4 +++-
 utils/nfsd/nfsd.man  |    3 +++
 3 files changed, 10 insertions(+), 2 deletions(-)



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

Patch

diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
index 03f1f2be534d..23aa4ea7d2f9 100644
--- a/systemd/nfs.conf.man
+++ b/systemd/nfs.conf.man
@@ -104,6 +104,7 @@  for details.
 .B nfsd
 Recognized values:
 .BR threads ,
+.BR port ,
 .BR grace-time ,
 .BR lease-time ,
 .BR udp ,
@@ -120,8 +121,10 @@  Version and protocol values are Boolean values as described above,
 and are also used by
 .BR rpc.mountd .
 Threads and the two times are integers.
+.B port
+and
 .B rdma
-is a service name or number.  See
+are service names or numbers.  See
 .BR rpc.nfsd (8)
 for details.
 
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index d8f873ba3717..7c72bf096d13 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -72,7 +72,6 @@  main(int argc, char **argv)
 	int lease = -1;
 
 	progname = basename(argv[0]);
-	port = "nfs";
 	haddr = xmalloc(sizeof(char *));
 	haddr[0] = NULL;
 
@@ -83,6 +82,9 @@  main(int argc, char **argv)
 	count = conf_get_num("nfsd", "threads", count);
 	grace = conf_get_num("nfsd", "grace-time", grace);
 	lease = conf_get_num("nfsd", "lease-time", lease);
+	port = conf_get_str("nfsd", "port");
+	if (!port)
+		port = "nfs";
 	rdma_port = conf_get_str("nfsd", "rdma");
 	if (conf_get_bool("nfsd", "udp", NFSCTL_UDPISSET(protobits)))
 		NFSCTL_UDPSET(protobits);
diff --git a/utils/nfsd/nfsd.man b/utils/nfsd/nfsd.man
index 7b9fbf21a947..bc00464b3517 100644
--- a/utils/nfsd/nfsd.man
+++ b/utils/nfsd/nfsd.man
@@ -131,6 +131,9 @@  The grace time, for both NFSv4 and NLM, in seconds.
 .B lease-time
 The lease time for NFSv4, in seconds.
 .TP
+.B port
+Set the port for TCP/UDP to bind to.
+.TP
 .B rdma
 Set RDMA port.  Use "rdma=nfsrdma" to enable standard port.
 .TP