public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Ed Schouten" <ed@il.fontys.nl>
Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [Patch] nfsd: Insecure port warning shows decimal IPv4 address
Date: Sun, 3 Oct 2004 12:32:54 -0700	[thread overview]
Message-ID: <20041003123254.4de22bfa.akpm@osdl.org> (raw)
In-Reply-To: <56986.217.121.83.210.1096826639.squirrel@217.121.83.210>

"Ed Schouten" <ed@il.fontys.nl> wrote:
>
> 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;
>   		}

There's a NIPQUAD macro to make this a bit tidier.

  reply	other threads:[~2004-10-03 19:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-03 18:03 [Patch] nfsd: Insecure port warning shows decimal IPv4 address Ed Schouten
2004-10-03 19:32 ` Andrew Morton [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041003123254.4de22bfa.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ed@il.fontys.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox