Date: Sat, 30 Jun 2018 12:17:50 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r335815 - projects/pnfs-planb-server/usr.sbin/nfsd Message-ID: <201806301217.w5UCHonN003717@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sat Jun 30 12:17:50 2018 New Revision: 335815 URL: https://svnweb.freebsd.org/changeset/base/335815 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: projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c Modified: projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c ============================================================================== --- projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c Sat Jun 30 12:14:20 2018 (r335814) +++ projects/pnfs-planb-server/usr.sbin/nfsd/nfsd.c Sat Jun 30 12:17:50 2018 (r335815) @@ -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?201806301217.w5UCHonN003717>