summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2015-07-08 09:52:15 -0400
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-07-10 05:35:45 -0700
commit09b808f008150acb980cdf0cd4f945b57aeb71a0 (patch)
treebe2393e050efdcfc27c4e31145c29d692da04e0a
parent87bce01f323621c106a7fde221ea406abede41fc (diff)
glusterd: use a real host name (instead of numeric) when we have one
Change-Id: Ie9cc201204d3d613e3e585cab066a07283db902c BUG: 1241274 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/11587 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 10c90d5cfc4..f225dce0599 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4279,6 +4279,7 @@ glusterd_remote_hostname_get (rpcsvc_request_t *req, char *remote_host, int len)
char *name = NULL;
char *hostname = NULL;
char *tmp_host = NULL;
+ char *canon = NULL;
int ret = 0;
name = req->trans->peerinfo.identifier;
@@ -4293,6 +4294,11 @@ glusterd_remote_hostname_get (rpcsvc_request_t *req, char *remote_host, int len)
goto out;
}
+ if ((gf_get_hostname_from_ip(hostname,&canon) == 0) && canon) {
+ GF_FREE(tmp_host);
+ tmp_host = hostname = canon;
+ }
+
strncpy (remote_host, hostname, strlen (hostname));