diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-02-12 03:53:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:35 -0500 |
commit | ad06e4bd62351bc569cca0f25d68c58dbd298146 (patch) | |
tree | 82024c01e61de32af17d3b67eac0bb93138a2954 /fs/nfsd/nfsfh.c | |
parent | 1ba951053f07187f6e77be664a4b6f8bf0ba7ae4 (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/nfsd/nfsfh.c')
-rw-r--r-- | fs/nfsd/nfsfh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index c59d6fbb7a6b..a0b4282cb284 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/mount.h> | 20 | #include <linux/mount.h> |
21 | #include <asm/pgtable.h> | 21 | #include <asm/pgtable.h> |
22 | 22 | ||
23 | #include <linux/sunrpc/clnt.h> | ||
23 | #include <linux/sunrpc/svc.h> | 24 | #include <linux/sunrpc/svc.h> |
24 | #include <linux/nfsd/nfsd.h> | 25 | #include <linux/nfsd/nfsd.h> |
25 | 26 | ||
@@ -180,10 +181,10 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
180 | /* Check if the request originated from a secure port. */ | 181 | /* Check if the request originated from a secure port. */ |
181 | error = nfserr_perm; | 182 | error = nfserr_perm; |
182 | if (!rqstp->rq_secure && EX_SECURE(exp)) { | 183 | if (!rqstp->rq_secure && EX_SECURE(exp)) { |
184 | char buf[RPC_MAX_ADDRBUFLEN]; | ||
183 | printk(KERN_WARNING | 185 | printk(KERN_WARNING |
184 | "nfsd: request from insecure port (%u.%u.%u.%u:%d)!\n", | 186 | "nfsd: request from insecure port %s!\n", |
185 | NIPQUAD(rqstp->rq_addr.sin_addr.s_addr), | 187 | svc_print_addr(rqstp, buf, sizeof(buf))); |
186 | ntohs(rqstp->rq_addr.sin_port)); | ||
187 | goto out; | 188 | goto out; |
188 | } | 189 | } |
189 | 190 | ||