From aa053b228e01ab079f86d24f3444b2389895effd Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Thu, 5 Jan 2017 11:28:44 +0530 Subject: eventsapi: Use `getaddrinfo` instead of `gethostbyname` `gethostbyname` is not thread safe. Use `getaddrinfo` to avoid any race or segfault while sending events BUG: 1410313 Change-Id: I164af1f8eb72501fb0ed47445e68d896f7c3e908 Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/16327 Reviewed-by: Atin Mukherjee NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Raghavendra G --- libglusterfs/src/common-utils.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libglusterfs/src/common-utils.h') diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 324555b34f5..b77b7ad97de 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -868,4 +868,8 @@ gf_bits_index (uint64_t n); const char* gf_fop_string (glusterfs_fop_t fop); + +char * +get_ip_from_addrinfo (struct addrinfo *addr, char **ip); + #endif /* _COMMON_UTILS_H */ -- cgit