debug.c: fix for ipv6 changes

closes #94
This commit is contained in:
rofl0r 2015-12-01 20:37:23 +00:00
parent 1294d0a004
commit 50c84176da

View File

@ -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));