summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-07-10 20:21:13 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-07-13 10:52:54 -0700
commit74717225b3203aab546844a1c16d495fc4efb0bb (patch)
treefe007817599d816f5396d15031adb0a0e88286ef /xlators
parent1e4cc18362df17f87001ec42605b51daf251e0db (diff)
glusterd: use a real host name (instead of numeric) when we have one
Change-Id: Ie9cc201204d3d613e3e585cab066a07283db902c BUG: 1241963 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> Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/11624
Diffstat (limited to 'xlators')
-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 64736b1a546..f3413230e44 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4283,6 +4283,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;
@@ -4297,6 +4298,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));