Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158553
b: refs/heads/master
c: 0e47f0d
h: refs/heads/master
i:
  158551: a6ed782
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Aug 9, 2009
1 parent bfd2b20 commit 40de82c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 82 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0c077df009f2f329875051ac5283df235288689
refs/heads/master: 0e47f0d665efcf1b45f293422d21d8383f07d122
81 changes: 0 additions & 81 deletions trunk/net/sunrpc/rpcb_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,6 @@ static int rpcb_enc_mapping(struct rpc_rqst *req, __be32 *p,
return 0;
}

static int rpcb_decode_getport(struct rpc_rqst *req, __be32 *p,
unsigned short *portp)
{
*portp = (unsigned short) ntohl(*p++);
dprintk("RPC: rpcb getport result: %u\n",
*portp);
return 0;
}

static int rpcb_dec_getport(struct rpc_rqst *req, __be32 *p,
struct rpcbind_args *rpcb)
{
Expand All @@ -752,15 +743,6 @@ static int rpcb_dec_getport(struct rpc_rqst *req, __be32 *p,
return 0;
}

static int rpcb_decode_set(struct rpc_rqst *req, __be32 *p,
unsigned int *boolp)
{
*boolp = (unsigned int) ntohl(*p++);
dprintk("RPC: rpcb set/unset call %s\n",
(*boolp ? "succeeded" : "failed"));
return 0;
}

static int rpcb_dec_set(struct rpc_rqst *req, __be32 *p,
unsigned int *boolp)
{
Expand Down Expand Up @@ -833,69 +815,6 @@ static int rpcb_enc_getaddr(struct rpc_rqst *req, __be32 *p,
return 0;
}

static int rpcb_decode_getaddr(struct rpc_rqst *req, __be32 *p,
unsigned short *portp)
{
char *addr;
u32 addr_len;
int c, i, f, first, val;

*portp = 0;
addr_len = ntohl(*p++);

if (addr_len == 0) {
dprintk("RPC: rpcb_decode_getaddr: "
"service is not registered\n");
return 0;
}

/*
* Simple sanity check.
*/
if (addr_len > RPCBIND_MAXUADDRLEN)
goto out_err;

/*
* Start at the end and walk backwards until the first dot
* is encountered. When the second dot is found, we have
* both parts of the port number.
*/
addr = (char *)p;
val = 0;
first = 1;
f = 1;
for (i = addr_len - 1; i > 0; i--) {
c = addr[i];
if (c >= '0' && c <= '9') {
val += (c - '0') * f;
f *= 10;
} else if (c == '.') {
if (first) {
*portp = val;
val = first = 0;
f = 1;
} else {
*portp |= (val << 8);
break;
}
}
}

/*
* Simple sanity check. If we never saw a dot in the reply,
* then this was probably just garbage.
*/
if (first)
goto out_err;

dprintk("RPC: rpcb_decode_getaddr port=%u\n", *portp);
return 0;

out_err:
dprintk("RPC: rpcbind server returned malformed reply\n");
return -EIO;
}

static int rpcb_dec_getaddr(struct rpc_rqst *req, __be32 *p,
struct rpcbind_args *rpcb)
{
Expand Down

0 comments on commit 40de82c

Please sign in to comment.