svn commit: r335814 - head/usr.sbin/nfsd
Rick Macklem
rmacklem at FreeBSD.org
Sat Jun 30 12:14:21 UTC 2018
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;
More information about the svn-src-all
mailing list