summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2015-07-08 09:52:15 -0400
committerRaghavendra Bhat <raghavendra@redhat.com>2015-07-12 23:24:05 -0700
commitc7d8d2ea1e4ad9e247b5876cf17d3a6e0d9af9ad (patch)
tree3b63f154fe830b76f5b9094d53e7739a49f1204d
parentd35d7c1bf986cacb65da912123b9a34ebe946bef (diff)
glusterd: use a real host name (instead of numeric) when we have one
Change-Id: Ie9cc201204d3d613e3e585cab066a07283db902c BUG: 1241275 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/11569 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
-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 707533efea6..b8934c45ab6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -6461,6 +6461,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;
@@ -6475,6 +6476,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));