diff --git a/binaries/aarch64/tpws b/binaries/aarch64/tpws index f5111d9d..1371cb61 100755 Binary files a/binaries/aarch64/tpws and b/binaries/aarch64/tpws differ diff --git a/binaries/arm/tpws b/binaries/arm/tpws index 8985e3b6..b0a4f727 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 78729346..be33c961 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 31d59f1d..f67517fa 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 c690d4be..bd05b60e 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 5e0d68e7..05172836 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 bf7fa69c..10d839ae 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 861cf43a..3d191fa7 100755 Binary files a/binaries/ppc/tpws and b/binaries/ppc/tpws differ diff --git a/binaries/x86/tpws b/binaries/x86/tpws index cc512f27..a7e4f778 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 a3a3a8bd..f05e9e10 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 913d4675..1f0346da 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 37a660ea..34e45193 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 ce50884e..d35dc8b0 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);