summaryrefslogtreecommitdiff
path: root/sbin/mount_nfs/mount_nfs.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-06-17 20:53:29 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-06-17 20:53:29 +0000
commitcf9a49c7d2fa54de127763243611572e38a100d1 (patch)
tree5e6f84d24d800b284340483738f7e5460d01d31d /sbin/mount_nfs/mount_nfs.c
parent0b0e60912b32bef0b9fea412b6d5fb914e23e296 (diff)
go back to UDP mounts by default until NFS/TCP is fixed
Diffstat (limited to 'sbin/mount_nfs/mount_nfs.c')
-rw-r--r--sbin/mount_nfs/mount_nfs.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 0e8599a484a..84d2406255f 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount_nfs.c,v 1.16 1999/05/31 17:26:12 millert Exp $ */
+/* $OpenBSD: mount_nfs.c,v 1.17 1999/06/17 20:53:28 millert Exp $ */
/* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */
/*
@@ -168,6 +168,7 @@ struct nfhret {
#define ISBGRND 2
int retrycnt;
int opflags = 0;
+int nfsproto = IPPROTO_UDP;
int mnttcp_ok = 1;
u_short port_no = 0;
int force2 = 0;
@@ -353,7 +354,7 @@ main(argc, argv)
nfsargsp->flags |= NFSMNT_SOFT;
if (altflags & ALTF_TCP) {
nfsargsp->sotype = SOCK_STREAM;
- mnttcp_ok = 2;
+ nfsproto = IPPROTO_TCP;
}
if (altflags & ALTF_PORT)
port_no = atoi(strstr(optarg, "port=") + 5);
@@ -391,7 +392,7 @@ main(argc, argv)
break;
case 'T':
nfsargsp->sotype = SOCK_STREAM;
- mnttcp_ok = 2;
+ nfsproto = IPPROTO_TCP;
break;
case 't':
num = strtol(optarg, &p, 10);
@@ -430,10 +431,6 @@ main(argc, argv)
spec = *argv++;
name = *argv;
- /* Use TCP for NFSV3 by default */
- if (mnttcp_ok == 1 && (nfsargsp->flags & NFSMNT_NFSV3))
- nfsargsp->sotype = SOCK_STREAM;
-
if (!getnfsargs(spec, nfsargsp))
exit(1);
if (mount(MOUNT_NFS, name, mntflags, nfsargsp)) {
@@ -655,15 +652,6 @@ tryagain:
if ((tport = port_no ? port_no : pmap_getport(&saddr,
RPCPROG_NFS, nfsvers, nfsargsp->sotype == SOCK_STREAM ?
IPPROTO_TCP : IPPROTO_UDP)) == 0) {
- /*
- * If user didn't specifically request TCP,
- * fall back to UDP for NFSV3 mounts.
- */
- if (nfsvers == NFS_VER3 && mnttcp_ok == 1) {
- nfsargsp->sotype = SOCK_DGRAM;
- mnttcp_ok = 0;
- continue;
- }
if ((opflags & ISBGRND) == 0)
clnt_pcreateerror("NFS Portmap");
} else {