summaryrefslogtreecommitdiff
path: root/src/irc/dcc/dcc.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2015-09-21 13:54:13 +0200
committerLemonBoy <thatlemon@gmail.com>2015-09-21 14:19:35 +0200
commitffaa890e99e2176ff3d2dec0ab5a8136e1e946ff (patch)
tree8c3765d9736a0f86037b42c18fd3c1553b4a2434 /src/irc/dcc/dcc.c
parent0912a1105058829559529e2ae7d62daccb8337f6 (diff)
downloadirssi-ffaa890e99e2176ff3d2dec0ab5a8136e1e946ff.zip
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.
Diffstat (limited to 'src/irc/dcc/dcc.c')
-rw-r--r--src/irc/dcc/dcc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index 17f6c477..7fef2ae5 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -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;