summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorkarl <karl@FreeBSD.org>1995-06-14 17:41:04 +0000
committerkarl <karl@FreeBSD.org>1995-06-14 17:41:04 +0000
commit909ce53e787f57527bc564cf7b83e1826e49a1b9 (patch)
tree7699428c6b6de9dc9a5988c4ca875d2890272ee4 /sbin
parent0d486c5e120ec959743efcda53e35d6963dcca53 (diff)
downloadFreeBSD-src-909ce53e787f57527bc564cf7b83e1826e49a1b9.zip
FreeBSD-src-909ce53e787f57527bc564cf7b83e1826e49a1b9.tar.gz
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.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount_nfs/mount_nfs.86
-rw-r--r--sbin/mount_nfs/mount_nfs.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8
index decac6e..0209b49 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 3d5f579..9aa15ce 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)
OpenPOWER on IntegriCloud