Fix PR/2884: Change default for nfs mounts to not do a connect on the

socket. Add option -C to force a connected mount. Now option -c is still
there, but it is the default. Maybe amd should be changed similarly.
This commit is contained in:
christos 1996-10-27 21:18:03 +00:00
parent 2ada6af51b
commit f95a0b9a4d
2 changed files with 24 additions and 13 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mount_nfs.8,v 1.3 1996/02/18 11:59:10 fvdl Exp $
.\" $NetBSD: mount_nfs.8,v 1.4 1996/10/27 21:18:03 christos Exp $
.\"
.\" Copyright (c) 1992, 1993, 1994, 1995
.\" The Regents of the University of California. All rights reserved.
@ -41,7 +41,7 @@
.Nd mount nfs file systems
.Sh SYNOPSIS
.Nm mount_nfs
.Op Fl 23KPTUbcdilqs
.Op Fl 23KPTUbcCdilqs
.Op Fl D Ar deadthresh
.Op Fl I Ar readdirsize
.Op Fl L Ar leaseterm
@ -136,8 +136,16 @@ where the filesystem mount is not critical to multiuser operation.
.It Fl c
For UDP mount points, do not do a
.Xr connect 2 .
This must be used for servers that do not reply to requests from the
standard NFS port number 2049.
This flag is deprecated and connectionless UDP mounts are the default.
.It Fl C
For UDP mount points, do a
.Xr connect 2 .
Although this flag increases the efficiency of UDP mounts it cannot
be used for servers that do not reply to requests from the
standard NFS port number 2049, or for servers with multiple network
interfaces. In these cases if the socket is connected and the server
replies from a different port number or a different network interface
the client will get ICMP port unreachable and the mount will hang.
.It Fl d
Turn off the dynamic retransmit timeout estimator.
This may be useful for UDP mounts that exhibit high retry rates,

View File

@ -1,4 +1,4 @@
/* $NetBSD: mount_nfs.c,v 1.13 1996/05/23 22:52:49 fvdl Exp $ */
/* $NetBSD: mount_nfs.c,v 1.14 1996/10/27 21:18:04 christos Exp $ */
/*
* Copyright (c) 1992, 1993, 1994
@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: mount_nfs.c,v 1.13 1996/05/23 22:52:49 fvdl Exp $";
static char rcsid[] = "$NetBSD: mount_nfs.c,v 1.14 1996/10/27 21:18:04 christos Exp $";
#endif
#endif /* not lint */
@ -93,7 +93,7 @@ static char rcsid[] = "$NetBSD: mount_nfs.c,v 1.13 1996/05/23 22:52:49 fvdl Exp
#include "mntopts.h"
#define ALTF_BG 0x1
#define ALTF_NOCONN 0x2
#define ALTF_CONN 0x2
#define ALTF_DUMBTIMR 0x4
#define ALTF_INTR 0x8
#define ALTF_KERB 0x10
@ -112,7 +112,7 @@ const struct mntopt mopts[] = {
MOPT_FORCE,
MOPT_UPDATE,
{ "bg", 0, ALTF_BG, 1 },
{ "conn", 1, ALTF_NOCONN, 1 },
{ "conn", 0, ALTF_CONN, 1 },
{ "dumbtimer", 0, ALTF_DUMBTIMR, 1 },
{ "intr", 0, ALTF_INTR, 1 },
#ifdef NFSKERB
@ -140,7 +140,7 @@ struct nfs_args nfsdefargs = {
0,
(u_char *)0,
0,
NFSMNT_NFSV3,
NFSMNT_NFSV3|NFSMNT_NOCONN,
NFS_WSIZE,
NFS_RSIZE,
NFS_READDIRSIZE,
@ -226,7 +226,7 @@ main(argc, argv)
nfsargs = nfsdefargs;
nfsargsp = &nfsargs;
while ((c = getopt(argc, argv,
"23a:bcdD:g:I:iKL:lm:o:PpqR:r:sTt:w:x:U")) != EOF)
"23a:bcCdD:g:I:iKL:lm:o:PpqR:r:sTt:w:x:U")) != EOF)
switch (c) {
case '3':
if (force2)
@ -252,6 +252,9 @@ main(argc, argv)
case 'c':
nfsargsp->flags |= NFSMNT_NOCONN;
break;
case 'C':
nfsargsp->flags &= ~NFSMNT_NOCONN;
break;
case 'D':
num = strtol(optarg, &p, 10);
if (*p || num <= 0)
@ -307,8 +310,8 @@ main(argc, argv)
getmntopts(optarg, mopts, &mntflags, &altflags);
if(altflags & ALTF_BG)
opflags |= BGRND;
if(altflags & ALTF_NOCONN)
nfsargsp->flags |= NFSMNT_NOCONN;
if(altflags & ALTF_CONN)
nfsargsp->flags &= ~NFSMNT_NOCONN;
if(altflags & ALTF_DUMBTIMR)
nfsargsp->flags |= NFSMNT_DUMBTIMR;
if(altflags & ALTF_INTR)
@ -790,7 +793,7 @@ __dead void
usage()
{
(void)fprintf(stderr, "usage: mount_nfs %s\n%s\n%s\n%s\n",
"[-23bcdiKklMPqsT] [-a maxreadahead] [-D deadthresh]",
"[-23bcCdiKklMPqsT] [-a maxreadahead] [-D deadthresh]",
"\t[-g maxgroups] [-L leaseterm] [-m realm] [-o options] [-R retrycnt]",
"\t[-r readsize] [-t timeout] [-w writesize] [-x retrans]",
"\trhost:path node");