Mercurial > pidgin
changeset 29042:0257b8fe21d6
proxy: Fix printing IPv6 addresses
From "0:0:2001:6f8:999::" (wrong) to "2001:6f8:999::1" (correct).
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sun, 14 Feb 2010 08:05:08 +0000 |
parents | bd09de7f3558 |
children | 97974856c920 |
files | libpurple/proxy.c |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/proxy.c Sun Feb 14 07:33:34 2010 +0000 +++ b/libpurple/proxy.c Sun Feb 14 08:05:08 2010 +0000 @@ -2100,8 +2100,12 @@ addr = connect_data->hosts->data; connect_data->hosts = g_slist_remove(connect_data->hosts, connect_data->hosts->data); #ifdef HAVE_INET_NTOP - inet_ntop(addr->sa_family, &((struct sockaddr_in *)addr)->sin_addr, - ipaddr, sizeof(ipaddr)); + if (addr->sa_family == AF_INET) + inet_ntop(addr->sa_family, &((struct sockaddr_in *)addr)->sin_addr, + ipaddr, sizeof(ipaddr)); + else if (addr->sa_family == AF_INET6) + inet_ntop(addr->sa_family, &((struct sockaddr_in6 *)addr)->sin6_addr, + ipaddr, sizeof(ipaddr)); #else memcpy(ipaddr, inet_ntoa(((struct sockaddr_in *)addr)->sin_addr), sizeof(ipaddr));