diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2015-09-22 17:43:31 +0200 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2015-09-22 17:43:31 +0200 |
commit | 2d69deb0a36516bac9514c6d53a1389b0a4b031a (patch) | |
tree | 7187386b84c626c66a7f56a2ad9140647dc236d7 /src/irc | |
parent | 5ced71e1ac5cf74e46115ade90fa9004e6fe1493 (diff) | |
parent | 564829610de20f75ec667f1943524c3a49b9ea3f (diff) | |
download | irssi-2d69deb0a36516bac9514c6d53a1389b0a4b031a.zip |
Merge pull request #290 from LemonBoy/ipv6
Network and IPv{4,6} related changes
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/dcc/dcc.c | 4 | ||||
-rw-r--r-- | src/irc/proxy/listen.c | 9 |
2 files changed, 5 insertions, 8 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; diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c index dcc94e6b..16950c79 100644 --- a/src/irc/proxy/listen.c +++ b/src/irc/proxy/listen.c @@ -585,7 +585,7 @@ static LISTEN_REC *find_listen(const char *ircnet, int port) static void add_listen(const char *ircnet, int port) { LISTEN_REC *rec; - IPADDR ip4, ip6, *my_ip; + IPADDR ip, *my_ip; if (port <= 0 || *ircnet == '\0') return; @@ -593,16 +593,13 @@ static void add_listen(const char *ircnet, int port) /* bind to specific host/ip? */ my_ip = NULL; if (*settings_get_str("irssiproxy_bind") != '\0') { - if (net_gethostbyname(settings_get_str("irssiproxy_bind"), - &ip4, &ip6) != 0) { + if (net_gethostbyname(settings_get_str("irssiproxy_bind"), &ip) != 0) { printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Proxy: can not resolve '%s' - aborting", settings_get_str("irssiproxy_bind")); return; } - - my_ip = ip6.family == 0 ? &ip4 : ip4.family == 0 || - settings_get_bool("resolve_prefer_ipv6") ? &ip6 : &ip4; + my_ip = &ip; } rec = g_new0(LISTEN_REC, 1); |