diff --git a/src/core/lib/iomgr/socket_utils.h b/src/core/lib/iomgr/socket_utils.h index f0b5a33b638..79903571a01 100644 --- a/src/core/lib/iomgr/socket_utils.h +++ b/src/core/lib/iomgr/socket_utils.h @@ -43,7 +43,7 @@ #endif /* A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems */ -const char *grpc_inet_ntop(int af, const void *src, +const char *grpc_inet_ntop(int af, void *src, char *dst, socklen_t size); #endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */ diff --git a/src/core/lib/iomgr/socket_utils_common_posix.c b/src/core/lib/iomgr/socket_utils_common_posix.c index 21432568465..42ee76d2fe7 100644 --- a/src/core/lib/iomgr/socket_utils_common_posix.c +++ b/src/core/lib/iomgr/socket_utils_common_posix.c @@ -297,9 +297,9 @@ grpc_error *grpc_create_dualstack_socket(const struct sockaddr *addr, int type, return error_for_fd(*newfd, addr); } -const char *grpc_inet_ntop(int af, const void *src, +const char *grpc_inet_ntop(int af, void *src, char *dst, socklen_t size) { - return inet_ntop(af, src, dst, size); + return inet_ntop(af, (const void*)src, dst, size); } #endif diff --git a/src/core/lib/iomgr/socket_utils_windows.c b/src/core/lib/iomgr/socket_utils_windows.c index c65812fec67..c1dfc6e96f8 100644 --- a/src/core/lib/iomgr/socket_utils_windows.c +++ b/src/core/lib/iomgr/socket_utils_windows.c @@ -39,7 +39,7 @@ #include -const char *grpc_inet_ntop(int af, const void *src, +const char *grpc_inet_ntop(int af, void *src, char *dst, socklen_t size) { GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t)); return InetNtopA(af, src, dst, (size_t)size);