mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
Initial work to make irssi respect the resolved ip order
Ip's aren't selected using random() anymore, also select the ip version by using getaddrinfo and some proper hints.
This commit is contained in:
parent
0912a11050
commit
ffaa890e99
17 changed files with 87 additions and 236 deletions
|
|
@ -264,12 +264,12 @@ GIOChannel *dcc_connect_ip(IPADDR *ip, int port)
|
|||
}
|
||||
|
||||
if (own_ip == NULL)
|
||||
own_ip = IPADDR_IS_V6(ip) ? source_host_ip6 : source_host_ip4;
|
||||
own_ip = &source_host_ip;
|
||||
|
||||
handle = net_connect_ip(ip, port, own_ip);
|
||||
if (handle == NULL && errno == EADDRNOTAVAIL && own_ip != NULL) {
|
||||
/* dcc_own_ip is external address */
|
||||
own_ip = IPADDR_IS_V6(ip) ? source_host_ip6 : source_host_ip4;
|
||||
own_ip = &source_host_ip;
|
||||
handle = net_connect_ip(ip, port, own_ip);
|
||||
}
|
||||
return handle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue