From 2f800e5593da7a7addda89f5b579ddaa7684d15c Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Sat, 30 Jun 2018 12:14:20 +0000 Subject: [PATCH] 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". --- usr.sbin/nfsd/nfsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index fd29e2afb3a2..4f623db087b4 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -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;