aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/clntlock.c2
-rw-r--r--fs/lockd/host.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index 94d42cc4e393..1f3b0fc0d351 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -61,7 +61,7 @@ struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init)
61 61
62 host = nlmclnt_lookup_host(nlm_init->address, nlm_init->addrlen, 62 host = nlmclnt_lookup_host(nlm_init->address, nlm_init->addrlen,
63 nlm_init->protocol, nlm_version, 63 nlm_init->protocol, nlm_version,
64 nlm_init->hostname); 64 nlm_init->hostname, nlm_init->noresvport);
65 if (host == NULL) { 65 if (host == NULL) {
66 lockd_down(); 66 lockd_down();
67 return ERR_PTR(-ENOLCK); 67 return ERR_PTR(-ENOLCK);
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 70fc63a1727b..acc2aa5021d1 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -48,6 +48,7 @@ struct nlm_lookup_host_info {
48 const size_t hostname_len; /* it's length */ 48 const size_t hostname_len; /* it's length */
49 const struct sockaddr *src_sap; /* our address (optional) */ 49 const struct sockaddr *src_sap; /* our address (optional) */
50 const size_t src_len; /* it's length */ 50 const size_t src_len; /* it's length */
51 const int noresvport; /* use non-priv port */
51}; 52};
52 53
53/* 54/*
@@ -222,6 +223,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
222 host->h_nsmstate = 0; /* real NSM state */ 223 host->h_nsmstate = 0; /* real NSM state */
223 host->h_nsmhandle = nsm; 224 host->h_nsmhandle = nsm;
224 host->h_server = ni->server; 225 host->h_server = ni->server;
226 host->h_noresvport = ni->noresvport;
225 hlist_add_head(&host->h_hash, chain); 227 hlist_add_head(&host->h_hash, chain);
226 INIT_LIST_HEAD(&host->h_lockowners); 228 INIT_LIST_HEAD(&host->h_lockowners);
227 spin_lock_init(&host->h_lock); 229 spin_lock_init(&host->h_lock);
@@ -272,6 +274,7 @@ nlm_destroy_host(struct nlm_host *host)
272 * @protocol: transport protocol to use 274 * @protocol: transport protocol to use
273 * @version: NLM protocol version 275 * @version: NLM protocol version
274 * @hostname: '\0'-terminated hostname of server 276 * @hostname: '\0'-terminated hostname of server
277 * @noresvport: 1 if non-privileged port should be used
275 * 278 *
276 * Returns an nlm_host structure that matches the passed-in 279 * Returns an nlm_host structure that matches the passed-in
277 * [server address, transport protocol, NLM version, server hostname]. 280 * [server address, transport protocol, NLM version, server hostname].
@@ -281,7 +284,9 @@ nlm_destroy_host(struct nlm_host *host)
281struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, 284struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
282 const size_t salen, 285 const size_t salen,
283 const unsigned short protocol, 286 const unsigned short protocol,
284 const u32 version, const char *hostname) 287 const u32 version,
288 const char *hostname,
289 int noresvport)
285{ 290{
286 const struct sockaddr source = { 291 const struct sockaddr source = {
287 .sa_family = AF_UNSPEC, 292 .sa_family = AF_UNSPEC,
@@ -296,6 +301,7 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
296 .hostname_len = strlen(hostname), 301 .hostname_len = strlen(hostname),
297 .src_sap = &source, 302 .src_sap = &source,
298 .src_len = sizeof(source), 303 .src_len = sizeof(source),
304 .noresvport = noresvport,
299 }; 305 };
300 306
301 dprintk("lockd: %s(host='%s', vers=%u, proto=%s)\n", __func__, 307 dprintk("lockd: %s(host='%s', vers=%u, proto=%s)\n", __func__,
@@ -417,6 +423,8 @@ nlm_bind_host(struct nlm_host *host)
417 */ 423 */
418 if (!host->h_server) 424 if (!host->h_server)
419 args.flags |= RPC_CLNT_CREATE_HARDRTRY; 425 args.flags |= RPC_CLNT_CREATE_HARDRTRY;
426 if (host->h_noresvport)
427 args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
420 428
421 clnt = rpc_create(&args); 429 clnt = rpc_create(&args);
422 if (!IS_ERR(clnt)) 430 if (!IS_ERR(clnt))