From ffaa890e99e2176ff3d2dec0ab5a8136e1e946ff Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 21 Sep 2015 13:54:13 +0200 Subject: 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. --- src/irc/dcc/dcc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/irc/dcc') 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; -- cgit v1.2.3