aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-02-12 03:53:32 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:35 -0500
commitad06e4bd62351bc569cca0f25d68c58dbd298146 (patch)
tree82024c01e61de32af17d3b67eac0bb93138a2954 /fs/nfs/callback.c
parent1ba951053f07187f6e77be664a4b6f8bf0ba7ae4 (diff)
[PATCH] knfsd: SUNRPC: Add a function to format the address in an svc_rqst for printing
There are loads of places where the RPC server assumes that the rq_addr fields contains an IPv4 address. Top among these are error and debugging messages that display the server's IP address. Let's refactor the address printing into a separate function that's smart enough to figure out the difference between IPv4 and IPv6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r--fs/nfs/callback.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index a070109fa6c7..8c790af85984 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -71,6 +71,8 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
71 complete(&nfs_callback_info.started); 71 complete(&nfs_callback_info.started);
72 72
73 for(;;) { 73 for(;;) {
74 char buf[RPC_MAX_ADDRBUFLEN];
75
74 if (signalled()) { 76 if (signalled()) {
75 if (nfs_callback_info.users == 0) 77 if (nfs_callback_info.users == 0)
76 break; 78 break;
@@ -88,8 +90,8 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
88 __FUNCTION__, -err); 90 __FUNCTION__, -err);
89 break; 91 break;
90 } 92 }
91 dprintk("%s: request from %u.%u.%u.%u\n", __FUNCTION__, 93 dprintk("%s: request from %s\n", __FUNCTION__,
92 NIPQUAD(rqstp->rq_addr.sin_addr.s_addr)); 94 svc_print_addr(rqstp, buf, sizeof(buf)));
93 svc_process(rqstp); 95 svc_process(rqstp);
94 } 96 }
95 97
@@ -166,13 +168,17 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp)
166{ 168{
167 struct sockaddr_in *addr = &rqstp->rq_addr; 169 struct sockaddr_in *addr = &rqstp->rq_addr;
168 struct nfs_client *clp; 170 struct nfs_client *clp;
171 char buf[RPC_MAX_ADDRBUFLEN];
169 172
170 /* Don't talk to strangers */ 173 /* Don't talk to strangers */
171 clp = nfs_find_client(addr, 4); 174 clp = nfs_find_client(addr, 4);
172 if (clp == NULL) 175 if (clp == NULL)
173 return SVC_DROP; 176 return SVC_DROP;
174 dprintk("%s: %u.%u.%u.%u NFSv4 callback!\n", __FUNCTION__, NIPQUAD(addr->sin_addr)); 177
178 dprintk("%s: %s NFSv4 callback!\n", __FUNCTION__,
179 svc_print_addr(rqstp, buf, sizeof(buf)));
175 nfs_put_client(clp); 180 nfs_put_client(clp);
181
176 switch (rqstp->rq_authop->flavour) { 182 switch (rqstp->rq_authop->flavour) {
177 case RPC_AUTH_NULL: 183 case RPC_AUTH_NULL:
178 if (rqstp->rq_proc != CB_NULL) 184 if (rqstp->rq_proc != CB_NULL)