diff options
author | Karl Strickland <karl@FreeBSD.org> | 1995-06-14 17:41:04 +0000 |
---|---|---|
committer | Karl Strickland <karl@FreeBSD.org> | 1995-06-14 17:41:04 +0000 |
commit | bc2cfd713102edb487362be1bf5493bcb924194a (patch) | |
tree | 7699428c6b6de9dc9a5988c4ca875d2890272ee4 /sbin/mount_nfs | |
parent | afbc52c4dc709604e243e591e8b1c91c33c00c87 (diff) | |
download | src-bc2cfd713102edb487362be1bf5493bcb924194a.tar.gz src-bc2cfd713102edb487362be1bf5493bcb924194a.zip |
Added -o port option. Use specified port number for NFS requests. The default
is to query the portmapper for the NFS port. This is useful for CFS users.
Notes
Notes:
svn path=/head/; revision=9230
Diffstat (limited to 'sbin/mount_nfs')
-rw-r--r-- | sbin/mount_nfs/mount_nfs.8 | 6 | ||||
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8 index decac6efefed..0209b49f3854 100644 --- a/sbin/mount_nfs/mount_nfs.8 +++ b/sbin/mount_nfs/mount_nfs.8 @@ -160,6 +160,12 @@ flag followed by a comma separated string of options. See the .Xr mount 8 man page for possible options and their meanings. +The following NFS specific option is also available: +.Bl -tag -width indent +.It port=<port_number> +Use specified port number for NFS requests. +The default is to query the portmapper for the NFS port. +.El .It Fl q Use the leasing extensions to the protocol to maintain cache consistency. This protocol, referred to as Not Quite Nfs (NQNFS), diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 3d5f5793d85c..9aa15ceec7c5 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -99,6 +99,7 @@ static char sccsid[] = "@(#)mount_nfs.c 8.3 (Berkeley) 3/27/94"; #define ALTF_NQNFS 0x400 #define ALTF_SOFT 0x800 #define ALTF_TCP 0x1000 +#define ALTF_PORT 0x2000 struct mntopt mopts[] = { MOPT_STDOPTS, @@ -121,6 +122,7 @@ struct mntopt mopts[] = { { "nqnfs", 0, ALTF_NQNFS, 1 }, { "soft", 0, ALTF_SOFT, 1 }, { "tcp", 0, ALTF_TCP, 1 }, + { "port=", 0, ALTF_PORT, 1 }, { NULL } }; @@ -151,6 +153,7 @@ struct nfhret { #define ISBGRND 2 int retrycnt = DEF_RETRY; int opflags = 0; +u_short port_no = 0; #ifdef KERBEROS char inst[INST_SZ]; @@ -289,6 +292,8 @@ main(argc, argv) nfsargsp->flags |= NFSMNT_SOFT; if(altflags & ALTF_TCP) nfsargsp->sotype = SOCK_STREAM; + if(altflags & ALTF_PORT) + port_no = atoi(strstr(optarg, "port=") + 5); altflags = 0; break; case 'P': @@ -521,7 +526,8 @@ getnfsargs(spec, nfsargsp) while (retrycnt > 0) { saddr.sin_family = AF_INET; saddr.sin_port = htons(PMAPPORT); - if ((tport = pmap_getport(&saddr, RPCPROG_NFS, + if ((tport = port_no ? port_no : + pmap_getport(&saddr, RPCPROG_NFS, NFS_VER2, nfsargsp->sotype == SOCK_STREAM ? IPPROTO_TCP : IPPROTO_UDP)) == 0) { if ((opflags & ISBGRND) == 0) |