From 8ba9fb24ff8ce99b9719a29e7b99b9604f52ca39 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 26 May 2014 12:24:47 +0200 Subject: [PATCH] Control socket small fix --- src/control_socket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/control_socket.cpp b/src/control_socket.cpp index 93d9a91c4..b22070d05 100644 --- a/src/control_socket.cpp +++ b/src/control_socket.cpp @@ -192,11 +192,12 @@ int control_init(int port, struct control_state **state, struct module *root_mod * from both IPv4 and IPv6 hosts. This behavior can be modified * using the IPPROTO_IPV6 level socket option IPV6_V6ONLY if required.*/ struct sockaddr_in6 s_in; + memset(&s_in, 0, sizeof(s_in)); s_in.sin6_family = AF_INET6; s_in.sin6_addr = in6addr_any; s_in.sin6_port = htons(s->network_port); - bind(s->socket_fd, (const struct sockaddr *) &s_in, sizeof(s_in)); + ::bind(s->socket_fd, (const struct sockaddr *) &s_in, sizeof(s_in)); listen(s->socket_fd, MAX_CLIENTS); } else { s->socket_fd = socket(AF_INET, SOCK_STREAM, 0);