From cf9a49c7d2fa54de127763243611572e38a100d1 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 17 Jun 1999 20:53:29 +0000 Subject: go back to UDP mounts by default until NFS/TCP is fixed --- sbin/mount_nfs/mount_nfs.8 | 16 +++++++++------- sbin/mount_nfs/mount_nfs.c | 20 ++++---------------- 2 files changed, 13 insertions(+), 23 deletions(-) (limited to 'sbin') diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8 index 52d44b53a57..fb364240fc6 100644 --- a/sbin/mount_nfs/mount_nfs.8 +++ b/sbin/mount_nfs/mount_nfs.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mount_nfs.8,v 1.14 1999/05/31 17:26:12 millert Exp $ +.\" $OpenBSD: mount_nfs.8,v 1.15 1999/06/17 20:53:27 millert Exp $ .\" $NetBSD: mount_nfs.8,v 1.3 1996/02/18 11:59:10 fvdl Exp $ .\" .\" Copyright (c) 1992, 1993, 1994, 1995 @@ -114,12 +114,11 @@ Set the retry count for doing the mount to the specified value. .It Fl T Use TCP transport instead of UDP. This is recommended for servers that are not on the same LAN cable as -the client. The default for NFS Version 3 mounts is to try TCP transport -first, and fall back to UDP if the mount fails. +the client. +(NB: This is NOT supported by most non-BSD servers.) .It Fl U -Force the mount protocol to use UDP transport, even for TCP NFS mounts -(necessary for some old BSD servers). This is the default for NFS Version -2 mounts. +Force the mount protocol to use UDP transport, even for TCP NFS mounts. +(Necessary for some old BSD servers.) .It Fl a Ar maxreadahead Set the read-ahead count to the specified value. This may be in the range of 0 - 4, and determines how many blocks @@ -251,4 +250,7 @@ transport, tuning such mounts is really a black art that can only be expected to have limited success. For clients mounting servers that are not on the same LAN cable or that tend to be overloaded, -TCP transport is strongly recommended. +TCP transport is strongly recommended, +but unfortunately this is restricted to mostly +.Bx 4.4 +servers. 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 { -- cgit v1.2.3