auth zone socket creation fix.
@@ -262,6 +262,7 @@ outnet_tcp_connect(int s, struct sockaddr_storage* addr, socklen_t addrlen)
log_err_addr("outgoing tcp: connect",
strerror(errno), addr, addrlen);
close(s);
+ return 0;
#ifdef EINPROGRESS
}
#endif
@@ -269,9 +270,9 @@ outnet_tcp_connect(int s, struct sockaddr_storage* addr, socklen_t addrlen)
if(WSAGetLastError() != WSAEINPROGRESS &&
WSAGetLastError() != WSAEWOULDBLOCK) {
closesocket(s);
+ return 0;
}
#endif
- return 0;
}
return 1;
}
@@ -2190,7 +2191,7 @@ fd_for_dest(struct outside_network* outnet, struct sockaddr_storage* to_addr,
struct sockaddr_in* sa = (struct sockaddr_in*)addr;
sa->sin_port = (in_port_t)htons((uint16_t)port);
fd = create_udp_sock(AF_INET, SOCK_DGRAM,
- (struct sockaddr*)&sa, addrlen, 1, &inuse, &noproto,
+ (struct sockaddr*)addr, addrlen, 1, &inuse, &noproto,
0, 0, 0, NULL, 0, freebind, 0);
}
if(fd != -1) {
