public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 3/5] statd: statd fails to monitor if no reverse mapping of mon_name exists
Date: Mon, 23 Aug 2010 13:11:12 -0400	[thread overview]
Message-ID: <20100823171112.2123.24635.stgit@matisse.1015granger.net> (raw)
In-Reply-To: <20100823170552.2123.43124.stgit@matisse.1015granger.net>

Commit 8ce130c4 switched in the new statd_canonical_name() function
that constructs a "unique" name statd can use to uniquely identify a
monitor record.

The legacy statd would monitor a client that sent an IP address with
no reverse map as its caller_name.  To remain bug-for-bug compatible,
allow this case in the new statd.

This shouldn't be a problem: statd_canonical_name() needs to create
a unique name for the monitored host so it can keep track of monitor
requests from the same remote.  The IP address itself should work as
well as the host's canonical name, in case there is no reverse
mapping.

We still enforce the requirement that a mon_name that is a DNS name
must have a forward map to an IP address.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/statd/hostname.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/utils/statd/hostname.c b/utils/statd/hostname.c
index 7d704cc..38f2265 100644
--- a/utils/statd/hostname.c
+++ b/utils/statd/hostname.c
@@ -212,7 +212,9 @@ statd_canonical_name(const char *hostname)
 					buf, (socklen_t)sizeof(buf));
 		freeaddrinfo(ai);
 		if (!result)
-			return NULL;
+			/* OK to use presentation address,
+			 * if no reverse map exists */
+			return strdup(hostname);
 		return strdup(buf);
 	}
 


  parent reply	other threads:[~2010-08-23 17:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 17:10 [PATCH 0/5] More mountd patches Chuck Lever
2010-08-23 17:10 ` [PATCH 1/5] libexport: Add a common exit label to check_netgroup() Chuck Lever
2010-08-23 17:11 ` [PATCH 2/5] libexport: Fix IP address check in check_netgroup() Chuck Lever
2010-08-23 17:11 ` Chuck Lever [this message]
2010-08-23 17:11 ` [PATCH 4/5] exportfs: exportfs.c no longer needs #include "xmalloc.h" Chuck Lever
2010-08-23 17:11 ` [PATCH 5/5] exportfs: Use xlog() for error reporting Chuck Lever
     [not found] ` <20100823170552.2123.43124.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2010-08-24 11:24   ` [PATCH 0/5] More mountd patches Steve Dickson

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=20100823171112.2123.24635.stgit@matisse.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /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