summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-01-14 12:24:23 -0500
committerSteve Dickson <steved@redhat.com>2010-01-15 14:55:52 -0500
commit17d144b236c84150c2ca896c0d3eea05931d938e (patch)
tree522a6a1cb70d3925262034bb92bc07b054cb2394
parent8ce130c4c828b9d13d429f22160f992b9c1d45cd (diff)
downloadnfs-utils-17d144b236c84150c2ca896c0d3eea05931d938e.tar.gz
nfs-utils-17d144b236c84150c2ca896c0d3eea05931d938e.tar.xz
nfs-utils-17d144b236c84150c2ca896c0d3eea05931d938e.zip
statd: Support IPv6 in sm_stat_1_svc()
SM_STAT is usually not used by most contemporary NSM implementations, but for consistency, it gets the same treatment as sm_mon_1_svc(), since both should use the same logic to determine whether a mon_name is able to be monitored. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
-rw-r--r--utils/statd/stat.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/utils/statd/stat.c b/utils/statd/stat.c
index 477f632..8d8b65e 100644
--- a/utils/statd/stat.c
+++ b/utils/statd/stat.c
@@ -12,7 +12,7 @@
#include <netdb.h>
#include "statd.h"
-/*
+/*
* Services SM_STAT requests.
*
* According the the X/Open spec's on this procedure: "Implementations
@@ -37,20 +37,23 @@
* other way to get it.
* 3/ That's what we always did in the past.
*/
-struct sm_stat_res *
-sm_stat_1_svc (struct sm_name *argp, struct svc_req *rqstp)
+struct sm_stat_res *
+sm_stat_1_svc(struct sm_name *argp,
+ __attribute__ ((unused)) struct svc_req *rqstp)
{
static sm_stat_res result;
+ char *name;
xlog(D_CALL, "Received SM_STAT from %s", argp->mon_name);
- if (gethostbyname (argp->mon_name) == NULL) {
- xlog_warn ("gethostbyname error for %s", argp->mon_name);
+ name = statd_canonical_name(argp->mon_name);
+ if (name == NULL) {
result.res_stat = STAT_FAIL;
xlog (D_GENERAL, "STAT_FAIL for %s", argp->mon_name);
} else {
result.res_stat = STAT_SUCC;
xlog (D_GENERAL, "STAT_SUCC for %s", argp->mon_name);
+ free(name);
}
result.state = MY_STATE;
return(&result);