static struct rpc_clnt * nsm_create(void);
-extern struct rpc_program nsm_program;
+static struct rpc_program nsm_program;
/*
* Local NSM state
xprt = xprt_create_proto(IPPROTO_UDP, &sin, NULL);
if (IS_ERR(xprt))
return (struct rpc_clnt *)xprt;
+ xprt->resvport = 1; /* NSM requires a reserved port */
clnt = rpc_create_client(xprt, "localhost",
&nsm_program, SM_VERSION,
RPC_AUTH_NULL);
if (IS_ERR(clnt))
- goto out_destroy;
+ goto out_err;
clnt->cl_softrtry = 1;
- clnt->cl_chatty = 1;
clnt->cl_oneshot = 1;
- xprt->resvport = 1; /* NSM requires a reserved port */
return clnt;
-out_destroy:
- xprt_destroy(xprt);
+out_err:
return clnt;
}
xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
{
char buffer[20];
- u32 addr = ntohl(argp->addr);
/*
* Use the dotted-quad IP address of the remote host as
* hostname first for whatever remote hostname it receives,
* so this works alright.
*/
- sprintf(buffer, "%d.%d.%d.%d", (addr>>24) & 0xff, (addr>>16) & 0xff,
- (addr>>8) & 0xff, (addr) & 0xff);
+ sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->addr));
if (!(p = xdr_encode_string(p, buffer))
|| !(p = xdr_encode_string(p, system_utsname.nodename)))
return ERR_PTR(-EIO);
static struct rpc_stat nsm_stats;
-struct rpc_program nsm_program = {
+static struct rpc_program nsm_program = {
.name = "statd",
.number = SM_PROGRAM,
.nrvers = sizeof(nsm_version)/sizeof(nsm_version[0]),