Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jun 2018 12:14:20 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335814 - head/usr.sbin/nfsd
Message-ID:  <201806301214.w5UCEKoP003446@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sat Jun 30 12:14:20 2018
New Revision: 335814
URL: https://svnweb.freebsd.org/changeset/base/335814

Log:
  Add a safety belt assignment to the nfsd for when "-p" isn't specified.
  
  The kernel code assumes that nfsdargs.addr == NULL and nfsdargs.addrlen == 0
  when there is no "-p" argument used for starting the nfsd.
  This small patch ensures this is the case. In practice, I believe this always
  happened, since "nfsdargs" was the last element on the stack for "main()",
  but this little patch ensures it will be the case.
  Spotted by inspection while adding a new optional field for "-p".

Modified:
  head/usr.sbin/nfsd/nfsd.c

Modified: head/usr.sbin/nfsd/nfsd.c
==============================================================================
--- head/usr.sbin/nfsd/nfsd.c	Sat Jun 30 10:04:44 2018	(r335813)
+++ head/usr.sbin/nfsd/nfsd.c	Sat Jun 30 12:14:20 2018	(r335814)
@@ -180,6 +180,8 @@ main(int argc, char **argv)
 	struct nfsd_nfsd_args nfsdargs;
 
 	nfsdargs.mirrorcnt = 1;
+	nfsdargs.addr = NULL;
+	nfsdargs.addrlen = 0;
 	nfsdcnt = DEFNFSDCNT;
 	unregister = reregister = tcpflag = maxsock = 0;
 	bindanyflag = udpflag = connect_type_cnt = bindhostc = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806301214.w5UCEKoP003446>