Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34777
b: refs/heads/master
c: ed39440
h: refs/heads/master
i:
  34775: 04384cb
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Sep 23, 2006
1 parent c217982 commit 7ba1b34
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbf7c1dd2ae2b4040b41b1065ee9b1b6905b1605
refs/heads/master: ed39440a2573abc926f230267000f21fa5a87822
1 change: 1 addition & 0 deletions trunk/include/linux/sunrpc/clnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
size_t rpc_max_payload(struct rpc_clnt *);
void rpc_force_rebind(struct rpc_clnt *);
int rpc_ping(struct rpc_clnt *clnt, int flags);
size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);

/*
* Helper function for NFSroot support
Expand Down
21 changes: 21 additions & 0 deletions trunk/net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,27 @@ rpc_call_setup(struct rpc_task *task, struct rpc_message *msg, int flags)
task->tk_action = rpc_exit_task;
}

/**
* rpc_peeraddr - extract remote peer address from clnt's xprt
* @clnt: RPC client structure
* @buf: target buffer
* @size: length of target buffer
*
* Returns the number of bytes that are actually in the stored address.
*/
size_t rpc_peeraddr(struct rpc_clnt *clnt, struct sockaddr *buf, size_t bufsize)
{
size_t bytes;
struct rpc_xprt *xprt = clnt->cl_xprt;

bytes = sizeof(xprt->addr);
if (bytes > bufsize)
bytes = bufsize;
memcpy(buf, &clnt->cl_xprt->addr, bytes);
return sizeof(xprt->addr);
}
EXPORT_SYMBOL(rpc_peeraddr);

void
rpc_setbufsize(struct rpc_clnt *clnt, unsigned int sndsize, unsigned int rcvsize)
{
Expand Down

0 comments on commit 7ba1b34

Please sign in to comment.