From 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 Mon Sep 17 00:00:00 2001 From: svn2git Date: Fri, 1 Jul 1994 00:00:00 -0800 Subject: Release FreeBSD 1.1.5.1 This commit was manufactured to restore the state of the 1.1.5.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs. --- sbin/mount/mount.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'sbin/mount/mount.c') diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 0d468233e78c..4c3bfa40a9c7 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -103,6 +103,7 @@ int retrycnt; #define BGRND 1 #define ISBGRND 2 int opflags = 0; +u_short serverport = 0; #endif main(argc, argv, arge) @@ -301,9 +302,11 @@ mountfs(spec, name, flags, type, options, mntopts) case MOUNT_NFS: retrycnt = DEF_RETRY; if (mntopts) - getnfsopts(mntopts, &nfsargs, &opflags, &retrycnt); + getnfsopts(mntopts, &nfsargs, &opflags, &retrycnt, + &serverport); if (options) - getnfsopts(options, &nfsargs, &opflags, &retrycnt); + getnfsopts(options, &nfsargs, &opflags, &retrycnt, + &serverport); if (argp = getnfsargs(spec, &nfsargs)) break; return (1); @@ -643,11 +646,12 @@ exclusive(a, b) * Handle the getoption arg. * Essentially update "opflags", "retrycnt" and "nfsargs" */ -getnfsopts(optarg, nfsargsp, opflagsp, retrycntp) +getnfsopts(optarg, nfsargsp, opflagsp, retrycntp, serverport) char *optarg; register struct nfs_args *nfsargsp; int *opflagsp; int *retrycntp; + u_short *serverport; { register char *cp, *nextcp; int num; @@ -696,6 +700,8 @@ getnfsopts(optarg, nfsargsp, opflagsp, retrycntp) } else if (!strcmp(cp, "retrans") && num > 0) { nfsargsp->retrans = num; nfsargsp->flags |= NFSMNT_RETRANS; + } else if (!strcmp(cp, "port") && num > 0) { + *serverport = num; } } if (nfsargsp->sotype == SOCK_DGRAM) { @@ -748,8 +754,10 @@ getnfsargs(spec, nfsargsp) while (retrycnt > 0) { saddr.sin_family = AF_INET; saddr.sin_port = htons(PMAPPORT); - if ((tport = pmap_getport(&saddr, RPCPROG_NFS, - NFS_VER2, IPPROTO_UDP)) == 0) { + tport = serverport; + if (serverport == 0 && + ((tport = pmap_getport(&saddr, RPCPROG_NFS, + NFS_VER2, IPPROTO_UDP)) == 0)) { if ((opflags & ISBGRND) == 0) clnt_pcreateerror("NFS Portmap"); } else { -- cgit v1.2.3