summaryrefslogtreecommitdiffstats
path: root/src/web_server.c
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2016-05-25 10:36:24 +0000
committerLennart Weller <lhw@ring0.de>2016-05-25 10:36:24 +0000
commitb4f64f72a3e4bf590c60b0cbd6cd365aa1a58542 (patch)
treee6706c727a1fedb44da614453ad3e429a7403a9b /src/web_server.c
parentImported Upstream version 1.1.0 (diff)
downloadnetdata-b4f64f72a3e4bf590c60b0cbd6cd365aa1a58542.tar.xz
netdata-b4f64f72a3e4bf590c60b0cbd6cd365aa1a58542.zip
Imported Upstream version 1.2.0upstream/1.2.0
Diffstat (limited to 'src/web_server.c')
-rw-r--r--src/web_server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/web_server.c b/src/web_server.c
index 10bf39a78..0da72b5be 100644
--- a/src/web_server.c
+++ b/src/web_server.c
@@ -67,7 +67,6 @@ int create_listen_socket4(const char *ip, int port, int listen_backlog)
{
int sock;
int sockopt = 1;
- struct sockaddr_in name;
debug(D_LISTENER, "IPv4 creating new listening socket on port %d", port);
@@ -80,6 +79,7 @@ int create_listen_socket4(const char *ip, int port, int listen_backlog)
/* avoid "address already in use" */
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&sockopt, sizeof(sockopt));
+ struct sockaddr_in name;
memset(&name, 0, sizeof(struct sockaddr_in));
name.sin_family = AF_INET;
name.sin_port = htons (port);
@@ -118,7 +118,6 @@ int create_listen_socket6(const char *ip, int port, int listen_backlog)
{
int sock = -1;
int sockopt = 1;
- struct sockaddr_in6 name;
debug(D_LISTENER, "IPv6 creating new listening socket on port %d", port);
@@ -131,6 +130,7 @@ int create_listen_socket6(const char *ip, int port, int listen_backlog)
/* avoid "address already in use" */
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&sockopt, sizeof(sockopt));
+ struct sockaddr_in6 name;
memset(&name, 0, sizeof(struct sockaddr_in6));
name.sin6_family = AF_INET6;
name.sin6_port = htons ((uint16_t) port);