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/core/servers-reconnect.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/core/servers-reconnect.c') diff --git a/src/core/servers-reconnect.c b/src/core/servers-reconnect.c index ae97ecd2..3ba18ad0 100644 --- a/src/core/servers-reconnect.c +++ b/src/core/servers-reconnect.c @@ -177,13 +177,9 @@ server_connect_copy_skeleton(SERVER_CONNECT_REC *src, int connect_info) dest->username = g_strdup(src->username); dest->realname = g_strdup(src->realname); - if (src->own_ip4 != NULL) { - dest->own_ip4 = g_new(IPADDR, 1); - memcpy(dest->own_ip4, src->own_ip4, sizeof(IPADDR)); - } - if (src->own_ip6 != NULL) { - dest->own_ip6 = g_new(IPADDR, 1); - memcpy(dest->own_ip6, src->own_ip6, sizeof(IPADDR)); + if (src->own_ip != NULL) { + dest->own_ip = g_new(IPADDR, 1); + memcpy(dest->own_ip, src->own_ip, sizeof(IPADDR)); } dest->channels = g_strdup(src->channels); -- cgit v1.2.3