mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-02 08:57:19 -04:00
[ipv6] this code was not tested
This commit is contained in:
parent
5188b8ab84
commit
d857560466
@ -648,13 +648,13 @@ connect_socket(struct socket *csocket, struct connection_state state)
|
|||||||
}
|
}
|
||||||
#ifdef CONFIG_IPV6
|
#ifdef CONFIG_IPV6
|
||||||
if (pf == PF_INET6 && to_bind_ipv6) {
|
if (pf == PF_INET6 && to_bind_ipv6) {
|
||||||
struct sockaddr_in sa;
|
struct sockaddr_in6 sa;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
memset(&sa, 0, sizeof sa);
|
memset(&sa, 0, sizeof sa);
|
||||||
sa.sin_family = AF_INET6;
|
sa.sin6_family = AF_INET6;
|
||||||
inet_pton(AF_INET6, bind_address_ipv6, &(sa.sin_addr));
|
inet_pton(AF_INET6, bind_address_ipv6, &(sa.sin6_addr));
|
||||||
sa.sin_port = htons(0);
|
sa.sin6_port = htons(0);
|
||||||
res = bind(sock, (struct sockaddr *)(void *)&sa, sizeof sa);
|
res = bind(sock, (struct sockaddr *)(void *)&sa, sizeof sa);
|
||||||
|
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user