diff --git a/binaries/aarch64/tpws b/binaries/aarch64/tpws index f5111d9..1371cb6 100755 Binary files a/binaries/aarch64/tpws and b/binaries/aarch64/tpws differ diff --git a/binaries/arm/tpws b/binaries/arm/tpws index 8985e3b..b0a4f72 100755 Binary files a/binaries/arm/tpws and b/binaries/arm/tpws differ diff --git a/binaries/freebsd-x64/tpws b/binaries/freebsd-x64/tpws index 7872934..be33c96 100755 Binary files a/binaries/freebsd-x64/tpws and b/binaries/freebsd-x64/tpws differ diff --git a/binaries/mac64/tpws b/binaries/mac64/tpws index 31d59f1..f67517f 100755 Binary files a/binaries/mac64/tpws and b/binaries/mac64/tpws differ diff --git a/binaries/mips32r1-lsb/tpws b/binaries/mips32r1-lsb/tpws index c690d4b..bd05b60 100755 Binary files a/binaries/mips32r1-lsb/tpws and b/binaries/mips32r1-lsb/tpws differ diff --git a/binaries/mips32r1-msb/tpws b/binaries/mips32r1-msb/tpws index 5e0d68e..0517283 100755 Binary files a/binaries/mips32r1-msb/tpws and b/binaries/mips32r1-msb/tpws differ diff --git a/binaries/mips64r2-msb/tpws b/binaries/mips64r2-msb/tpws index bf7fa69..10d839a 100755 Binary files a/binaries/mips64r2-msb/tpws and b/binaries/mips64r2-msb/tpws differ diff --git a/binaries/ppc/tpws b/binaries/ppc/tpws index 861cf43..3d191fa 100755 Binary files a/binaries/ppc/tpws and b/binaries/ppc/tpws differ diff --git a/binaries/x86/tpws b/binaries/x86/tpws index cc512f2..a7e4f77 100755 Binary files a/binaries/x86/tpws and b/binaries/x86/tpws differ diff --git a/binaries/x86_64/tpws b/binaries/x86_64/tpws index a3a3a8b..f05e9e1 100755 Binary files a/binaries/x86_64/tpws and b/binaries/x86_64/tpws differ diff --git a/binaries/x86_64/tpws_wsl.tgz b/binaries/x86_64/tpws_wsl.tgz index 913d467..1f0346d 100644 Binary files a/binaries/x86_64/tpws_wsl.tgz and b/binaries/x86_64/tpws_wsl.tgz differ diff --git a/tpws/helpers.c b/tpws/helpers.c index 37a660e..34e4519 100644 --- a/tpws/helpers.c +++ b/tpws/helpers.c @@ -155,8 +155,9 @@ bool saconvmapped(struct sockaddr_storage *a) bool is_localnet(const struct sockaddr *a) { - return a->sa_family==AF_INET && *(char*)&((struct sockaddr_in *)a)->sin_addr.s_addr==127 || - a->sa_family==AF_INET6 && saismapped((struct sockaddr_in6 *)a) && ((struct sockaddr_in6 *)a)->sin6_addr.s6_addr[12]==127; + // 0.0.0.0, ::ffff:0.0.0.0 = localhost in linux + return a->sa_family==AF_INET && (*(char*)&((struct sockaddr_in *)a)->sin_addr.s_addr==127 || !((struct sockaddr_in *)a)->sin_addr.s_addr) || + a->sa_family==AF_INET6 && saismapped((struct sockaddr_in6 *)a) && (((struct sockaddr_in6 *)a)->sin6_addr.s6_addr[12]==127 || !*(uint32_t*)(((struct sockaddr_in6 *)a)->sin6_addr.s6_addr+12)); } bool is_linklocal(const struct sockaddr_in6 *a) { diff --git a/tpws/tpws_conn.c b/tpws/tpws_conn.c index ce50884..d35dc8b 100644 --- a/tpws/tpws_conn.c +++ b/tpws/tpws_conn.c @@ -842,7 +842,7 @@ static bool handle_proxy_mode(tproxy_conn_t *conn, struct tailhead *conn_list) } if (params.debug>=2) { - printf("socks5 hostname resolved to : \n"); + printf("socks5 hostname resolved to :\n"); print_addrinfo(ai); } memcpy(&ss,ai->ai_addr,ai->ai_addrlen);