public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] nfsd: Insecure port warning shows decimal IPv4 address
@ 2004-10-03 18:03 Ed Schouten
  2004-10-03 19:32 ` Andrew Morton
       [not found] ` <Pine.LNX.4.10.10410031203240.7525-100000@netwinder.perches.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Ed Schouten @ 2004-10-03 18:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds

Hi guys,

Made a quick patch that changes dmesg(8) output to show IPv4 addresses in
decimal form instead of hexadecimal when you receive an insecure port
warning.
---

 nfsfh.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

--- 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-03 19:29:39.711659000 +0200
@@ -153,8 +153,11 @@
 		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 (%d.%d.%d.%d:%d)!\n",
+			       (unsigned char)(ntohl(rqstp->rq_addr.sin_addr.s_addr) >> 24),
+			       (unsigned char)(ntohl(rqstp->rq_addr.sin_addr.s_addr) >> 16),
+			       (unsigned char)(ntohl(rqstp->rq_addr.sin_addr.s_addr) >> 8),
+			       (unsigned char)(ntohl(rqstp->rq_addr.sin_addr.s_addr)),
 			       ntohs(rqstp->rq_addr.sin_port));
 			goto out;
 		}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-03 22:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-03 18:03 [Patch] nfsd: Insecure port warning shows decimal IPv4 address Ed Schouten
2004-10-03 19:32 ` Andrew Morton
2004-10-03 20:15   ` Ed Schouten
     [not found] ` <Pine.LNX.4.10.10410031203240.7525-100000@netwinder.perches.com>
2004-10-03 22:49   ` Ed Schouten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox