From fd4adca789b39194e8c448b1c93dc31f69428e05 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 6 May 2016 15:36:37 +0800 Subject: [PATCH] Fix #627 --- src/netutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/netutils.c b/src/netutils.c index c47061ed..1c6b1de9 100644 --- a/src/netutils.c +++ b/src/netutils.c @@ -92,12 +92,12 @@ int bind_to_address(int socket_fd, const char *host) struct sockaddr_in *addr = (struct sockaddr_in *)&storage; dns_pton(AF_INET, host, &addr->sin_addr); addr->sin_family = AF_INET; - return bind(socket_fd, addr, sizeof(struct sockaddr_in)); + return bind(socket_fd, (struct sockaddr *)addr, sizeof(struct sockaddr_in)); } else if (ip.version == 6) { struct sockaddr_in6 *addr = (struct sockaddr_in6 *)&storage; dns_pton(AF_INET6, host, &addr->sin6_addr); addr->sin6_family = AF_INET6; - return bind(socket_fd, addr, sizeof(struct sockaddr_in6)); + return bind(socket_fd, (struct sockaddr *)addr, sizeof(struct sockaddr_in6)); } } }