diff options
author | rofl0r <retnyg@gmx.net> | 2015-12-01 23:37:23 +0300 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2015-12-01 23:37:27 +0300 |
commit | 50c84176dac81562fd3fee40664aacbfe75be13b (patch) | |
tree | a90b268cc4fd389fb6742b3c9a95b702346a7af6 | |
parent | 1294d0a004686e390df9d65a08b9e2f90fd7b709 (diff) |
debug.c: fix for ipv6 changes
closes #94
-rw-r--r-- | src/debug.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/debug.c b/src/debug.c index 0a4e87d..245eb90 100644 --- a/src/debug.c +++ b/src/debug.c @@ -3,11 +3,15 @@ # include "core.h" # include "common.h" # include "debug.h" +#include <arpa/inet.h> void DUMP_PROXY_CHAIN(proxy_data *pchain, unsigned int count) { - char ip_buf[16]; + char ip_buf[INET6_ADDRSTRLEN]; for (; count; pchain++, count--) { - pc_stringfromipv4(&pchain->ip.octet[0], ip_buf); + if(!inet_ntop(pchain->ip.is_v6?AF_INET6:AF_INET,pchain->ip.addr.v6,ip_buf,sizeof ip_buf)) { + proxychains_write_log(LOG_PREFIX "error: ip address conversion failed\n"); + continue; + } PDEBUG("[%s] %s %s:%d", proxy_state_strmap[pchain->ps], proxy_type_strmap[pchain->pt], ip_buf, htons(pchain->port)); |