Created attachment 175710 [details] change sysctl in mountd.{c,8} When using the flag -n to mountd, it tries to change the (old) sysctl "vfs.nfsrv.nfs_privport". This should be vfs.nfsd.nfs_privport instead.
The attached patch looks fine for head and stable/11. It needs to be changed for stable/10, since mountd.c on stable/10 handles both the old and new server. I can do that when I MFC it. Btw, the new server defaults to vfs.nfsd.nfs_privport == 0, so it won't normally matter that "-n" doesn't change it.
A commit references this bug: Author: rmacklem Date: Tue Oct 25 00:52:42 UTC 2016 New revision: 307890 URL: https://svnweb.freebsd.org/changeset/base/307890 Log: mountd(8) was erroneously setting the sysctl for the old NFS server when the new/default NFS server was running, for the "-n" option. This patch fixes the problem for head and stable/11. For stable/10 the patch will need to be modified when MFC'd, since the stable/10 mountd.c handles both old and new NFS servers. Since the new NFS server uses vfs.nfsd.nfs_privport == 0 by default, there wouldn't have been many users affected by the code not setting it to 0 when the "-n" option was specified. PR: 213450 Submitted by: rs@bytecamp.net MFC after: 2 weeks Changes: head/usr.sbin/mountd/mountd.c
A commit references this bug: Author: rmacklem Date: Tue Oct 25 00:59:23 UTC 2016 New revision: 307891 URL: https://svnweb.freebsd.org/changeset/base/307891 Log: Fix the man page to reflect the change done by r307890 to mountd.c so that the "-n" option uses the sysctl for the new NFS server. This is a content change. PR: 213450 Submitted by: rs@bytecamp.net MFC after: 2 weeks Changes: head/usr.sbin/mountd/mountd.8
batch change of PRs untouched in 2018 marked "in progress" back to open.
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved. Thanks