Re: [Patch] nfsd: Insecure port warning shows decimal IPv4 address

From: Ed Schouten
Date: Sun Oct 03 2004 - 17:50:48 EST


On Sun, October 3, 2004 9:12 pm, Joe Perches said:
> There may be a couple of places where this could be done in fs/nfsd

True. After a quick look, I found another spot in nfsproc.c. Here's a new
patch, using the NIPQUAD macro.
---

nfsfh.c | 4 ++--
nfsproc.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff -u -r linux-2.6.9-rc3/fs/nfsd/nfsfh.c
linux-2.6.9-rc3-xbox/fs/nfsd/nfsfh.c
--- linux-2.6.9-rc3/fs/nfsd/nfsfh.c 2004-09-30 05:04:26.000000000 +0200
+++ linux-2.6.9-rc3-xbox/fs/nfsd/nfsfh.c 2004-10-04 00:45:16.926659000 +0200
@@ -153,8 +153,8 @@
error = nfserr_perm;
if (!rqstp->rq_secure && EX_SECURE(exp)) {
printk(KERN_WARNING
- "nfsd: request from insecure port (%08x:%d)!\n",
- ntohl(rqstp->rq_addr.sin_addr.s_addr),
+ "nfsd: request from insecure port (%u.%u.%u.%u:%d)!\n",
+ NIPQUAD(rqstp->rq_addr.sin_addr.s_addr),
ntohs(rqstp->rq_addr.sin_port));
goto out;
}
diff -u -r linux-2.6.9-rc3/fs/nfsd/nfsproc.c
linux-2.6.9-rc3-xbox/fs/nfsd/nfsproc.c
--- linux-2.6.9-rc3/fs/nfsd/nfsproc.c 2004-09-30 05:04:25.000000000 +0200
+++ linux-2.6.9-rc3-xbox/fs/nfsd/nfsproc.c 2004-10-04 00:44:58.225659000
+0200
@@ -128,8 +128,8 @@

if (NFSSVC_MAXBLKSIZE < argp->count) {
printk(KERN_NOTICE
- "oversized read request from %08x:%d (%d bytes)\n",
- ntohl(rqstp->rq_addr.sin_addr.s_addr),
+ "oversized read request from %u.%u.%u.%u:%d (%d bytes)\n",
+ NIPQUAD(rqstp->rq_addr.sin_addr.s_addr),
ntohs(rqstp->rq_addr.sin_port),
argp->count);
argp->count = NFSSVC_MAXBLKSIZE;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/