mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-05 04:14:01 +00:00
Fix #1059
This commit is contained in:
+1
-3
@@ -319,7 +319,7 @@ create_and_bind(const char *host, const char *port, int protocol)
|
||||
{
|
||||
struct addrinfo hints;
|
||||
struct addrinfo *result, *rp, *ipv4v6bindall;
|
||||
int s, listen_sock, is_port_reuse;
|
||||
int s, listen_sock = -1, is_port_reuse = 0;
|
||||
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
|
||||
@@ -356,8 +356,6 @@ create_and_bind(const char *host, const char *port, int protocol)
|
||||
}
|
||||
}
|
||||
|
||||
is_port_reuse = 0;
|
||||
|
||||
for (/*rp = result*/; rp != NULL; rp = rp->ai_next) {
|
||||
listen_sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
|
||||
if (listen_sock == -1) {
|
||||
|
||||
Reference in New Issue
Block a user