Bug 213450 - [nfs] mountd flag -n operates on wrong sysctl
Summary: [nfs] mountd flag -n operates on wrong sysctl
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.3-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: Rick Macklem
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-10-13 14:44 UTC by Robert Schulze
Modified: 2019-01-21 19:22 UTC (History)
2 users (show)

See Also:


Attachments
change sysctl in mountd.{c,8} (1.09 KB, patch)
2016-10-13 14:44 UTC, Robert Schulze
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schulze 2016-10-13 14:44:26 UTC
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.
Comment 1 Rick Macklem freebsd_committer freebsd_triage 2016-10-25 00:34:31 UTC
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.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-10-25 00:53:02 UTC
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
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-10-25 01:00:05 UTC
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
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2018-05-23 10:27:15 UTC
batch change of PRs untouched in 2018 marked "in progress" back to open.
Comment 5 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 19:22:12 UTC
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