aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/rpcb_clnt.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-07-14 16:03:28 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-15 18:08:47 -0400
commit423d8b064771f5cd8b706a4839b18db9bb6c3c59 (patch)
tree4dc1419dca3de0d31b4d2646794c5aa05a274fca /net/sunrpc/rpcb_clnt.c
parentcc5598b78fd320dd6d1f90c14491e08029f3c4f6 (diff)
SUNRPC: None of rpcb_create's callers wants a privileged source port
Clean up: Callers that required a privileged source port now use rpcb_create_local(), so we can remove the @privileged argument from rpcb_create(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r--net/sunrpc/rpcb_clnt.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index 35c1ded1fc47..691bd216f469 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -140,8 +140,7 @@ static struct rpc_clnt *rpcb_create_local(struct sockaddr *addr,
140} 140}
141 141
142static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, 142static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
143 size_t salen, int proto, u32 version, 143 size_t salen, int proto, u32 version)
144 int privileged)
145{ 144{
146 struct rpc_create_args args = { 145 struct rpc_create_args args = {
147 .protocol = proto, 146 .protocol = proto,
@@ -151,7 +150,8 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
151 .program = &rpcb_program, 150 .program = &rpcb_program,
152 .version = version, 151 .version = version,
153 .authflavor = RPC_AUTH_UNIX, 152 .authflavor = RPC_AUTH_UNIX,
154 .flags = RPC_CLNT_CREATE_NOPING, 153 .flags = (RPC_CLNT_CREATE_NOPING |
154 RPC_CLNT_CREATE_NONPRIVPORT),
155 }; 155 };
156 156
157 switch (srvaddr->sa_family) { 157 switch (srvaddr->sa_family) {
@@ -165,8 +165,6 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
165 return NULL; 165 return NULL;
166 } 166 }
167 167
168 if (!privileged)
169 args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
170 return rpc_create(&args); 168 return rpc_create(&args);
171} 169}
172 170
@@ -255,7 +253,7 @@ int rpcb_getport_sync(struct sockaddr_in *sin, u32 prog, u32 vers, int prot)
255 __func__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot); 253 __func__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot);
256 254
257 rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin, 255 rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin,
258 sizeof(*sin), prot, RPCBVERS_2, 0); 256 sizeof(*sin), prot, RPCBVERS_2);
259 if (IS_ERR(rpcb_clnt)) 257 if (IS_ERR(rpcb_clnt))
260 return PTR_ERR(rpcb_clnt); 258 return PTR_ERR(rpcb_clnt);
261 259
@@ -365,7 +363,7 @@ void rpcb_getport_async(struct rpc_task *task)
365 task->tk_pid, __func__, bind_version); 363 task->tk_pid, __func__, bind_version);
366 364
367 rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot, 365 rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
368 bind_version, 0); 366 bind_version);
369 if (IS_ERR(rpcb_clnt)) { 367 if (IS_ERR(rpcb_clnt)) {
370 status = PTR_ERR(rpcb_clnt); 368 status = PTR_ERR(rpcb_clnt);
371 dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n", 369 dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",