1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[ipv6] this code was not tested

This commit is contained in:
Witold Filipczyk 2020-05-05 21:44:37 +02:00
parent 5188b8ab84
commit d857560466

View File

@ -648,13 +648,13 @@ connect_socket(struct socket *csocket, struct connection_state state)
}
#ifdef CONFIG_IPV6
if (pf == PF_INET6 && to_bind_ipv6) {
struct sockaddr_in sa;
struct sockaddr_in6 sa;
int res;
memset(&sa, 0, sizeof sa);
sa.sin_family = AF_INET6;
inet_pton(AF_INET6, bind_address_ipv6, &(sa.sin_addr));
sa.sin_port = htons(0);
sa.sin6_family = AF_INET6;
inet_pton(AF_INET6, bind_address_ipv6, &(sa.sin6_addr));
sa.sin6_port = htons(0);
res = bind(sock, (struct sockaddr *)(void *)&sa, sizeof sa);
if (res < 0) {