Set socket family to family of proxy when using proxy.

This commit is contained in:
irungentoo 2014-08-15 12:06:13 -04:00
parent 7557b92fc9
commit bb1bb58352
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -544,7 +544,12 @@ TCP_Client_Connection *new_TCP_connection(IP_Port ip_port, const uint8_t *public
if (ip_port.ip.family != AF_INET && ip_port.ip.family != AF_INET6)
return NULL;
sock_t sock = socket(ip_port.ip.family, SOCK_STREAM, IPPROTO_TCP);
uint8_t family = ip_port.ip.family;
if (proxy_info)
family = proxy_info->ip_port.ip.family;
sock_t sock = socket(family, SOCK_STREAM, IPPROTO_TCP);
if (!sock_valid(sock)) {
return NULL;