If the admin has specified the "noresvport" option for an NFS mount
point, the kernel's NFS client uses an unprivileged source port for
the main NFS transport. The kernel's mountd client should use an
unprivileged port in this case as well.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
u32 version;
unsigned short protocol;
struct nfs_fh *fh;
+ int noresvport;
};
extern int nfs_mount(struct nfs_mount_request *info);
.program = &mnt_program,
.version = info->version,
.authflavor = RPC_AUTH_UNIX,
- .flags = 0,
};
struct rpc_clnt *mnt_clnt;
int status;
(info->hostname ? info->hostname : "server"),
info->dirpath);
+ if (info->noresvport)
+ args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
+
mnt_clnt = rpc_create(&args);
if (IS_ERR(mnt_clnt))
goto out_clnt_err;
.dirpath = args->nfs_server.export_path,
.protocol = args->mount_server.protocol,
.fh = root_fh,
+ .noresvport = args->flags & NFS_MOUNT_NORESVPORT,
};
int status;