diff options
Diffstat (limited to 'src/irc/dcc')
-rw-r--r-- | src/irc/dcc/dcc-chat.c | 6 | ||||
-rw-r--r-- | src/irc/dcc/dcc-get.c | 7 | ||||
-rw-r--r-- | src/irc/dcc/dcc.c | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/irc/dcc/dcc-chat.c b/src/irc/dcc/dcc-chat.c index c2b05595..2e45c2fc 100644 --- a/src/irc/dcc/dcc-chat.c +++ b/src/irc/dcc/dcc-chat.c @@ -362,6 +362,8 @@ static void sig_chat_connected(CHAT_DCC_REC *dcc) static void dcc_chat_connect(CHAT_DCC_REC *dcc) { + IPADDR *own_ip; + g_return_if_fail(IS_DCC_CHAT(dcc)); if (dcc->addrstr[0] == '\0' || @@ -370,8 +372,8 @@ static void dcc_chat_connect(CHAT_DCC_REC *dcc) return; } - dcc->handle = net_connect_ip(&dcc->addr, dcc->port, - source_host_ok ? source_host_ip : NULL); + own_ip = IPADDR_IS_V6(&dcc->addr) ? source_host_ip6 : source_host_ip4; + dcc->handle = net_connect_ip(&dcc->addr, dcc->port, own_ip); if (dcc->handle != NULL) { dcc->tagconn = g_input_add(dcc->handle, G_INPUT_WRITE | G_INPUT_READ, diff --git a/src/irc/dcc/dcc-get.c b/src/irc/dcc/dcc-get.c index df51c837..27f795dc 100644 --- a/src/irc/dcc/dcc-get.c +++ b/src/irc/dcc/dcc-get.c @@ -212,14 +212,15 @@ static void sig_dccget_connected(GET_DCC_REC *dcc) void dcc_get_connect(GET_DCC_REC *dcc) { + IPADDR *own_ip; + if (dcc->get_type == DCC_GET_DEFAULT) { dcc->get_type = settings_get_bool("dcc_autorename") ? DCC_GET_RENAME : DCC_GET_OVERWRITE; } - - dcc->handle = net_connect_ip(&dcc->addr, dcc->port, - source_host_ok ? source_host_ip : NULL); + own_ip = IPADDR_IS_V6(&dcc->addr) ? source_host_ip6 : source_host_ip4; + dcc->handle = net_connect_ip(&dcc->addr, dcc->port, own_ip); if (dcc->handle != NULL) { dcc->tagconn = g_input_add(dcc->handle, diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c index 326d922d..9bfbdd1b 100644 --- a/src/irc/dcc/dcc.c +++ b/src/irc/dcc/dcc.c @@ -154,7 +154,7 @@ void dcc_ip2str(IPADDR *ip, char *host) { unsigned long addr; - if (is_ipv6_addr(ip)) { + if (IPADDR_IS_V6(ip)) { /* IPv6 */ net_ip2host(ip, host); } else { |