Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108642343
D29449.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29449.diff
View Options
diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c
--- a/usr.sbin/nfsd/nfsd.c
+++ b/usr.sbin/nfsd/nfsd.c
@@ -101,6 +101,7 @@
static int backupfd; /* Fd for the backup stable restart file */
static const char *getopt_shortopts;
static const char *getopt_usage;
+static int nfs_minvers = NFS_VER2;
static int minthreads_set;
static int maxthreads_set;
@@ -170,7 +171,6 @@
int bindhostc, bindanyflag, rpcbreg, rpcbregcnt;
int nfssvc_addsock;
int longindex = 0;
- int nfs_minvers = NFS_VER2;
size_t nfs_minvers_size;
const char *lopt;
char **bindhost = NULL;
@@ -307,6 +307,16 @@
errx(1, "Out of memory");
}
+ if (unregister) {
+ /*
+ * Unregister before setting nfs_minvers, in case the
+ * value of vfs.nfsd.server_min_nfsvers has changed
+ * since registering with rpcbind.
+ */
+ unregistration();
+ exit (0);
+ }
+
nfs_minvers_size = sizeof(nfs_minvers);
error = sysctlbyname("vfs.nfsd.server_min_nfsvers", &nfs_minvers,
&nfs_minvers_size, NULL, 0);
@@ -316,10 +326,6 @@
nfs_minvers = NFS_VER2;
}
- if (unregister) {
- unregistration();
- exit (0);
- }
if (reregister) {
if (udpflag) {
memset(&hints, 0, sizeof hints);
@@ -935,8 +941,8 @@
static void
unregistration(void)
{
- if ((!rpcb_unset(NFS_PROGRAM, 2, NULL)) ||
- (!rpcb_unset(NFS_PROGRAM, 3, NULL)))
+ if ((nfs_minvers == NFS_VER2 && !rpcb_unset(NFS_PROGRAM, 2, NULL)) ||
+ (nfs_minvers <= NFS_VER3 && !rpcb_unset(NFS_PROGRAM, 3, NULL)))
syslog(LOG_ERR, "rpcb_unset failed");
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 28, 1:18 AM (10 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16232651
Default Alt Text
D29449.diff (1 KB)
Attached To
Mode
D29449: nfsd: don't report rpcb_unset() failures for NFSv4 only configuration
Attached
Detach File
Event Timeline
Log In to Comment