diff --git a/binaries/aarch64/tpws b/binaries/aarch64/tpws index 4903cbc..f5111d9 100755 Binary files a/binaries/aarch64/tpws and b/binaries/aarch64/tpws differ diff --git a/binaries/arm/tpws b/binaries/arm/tpws index 7836bd6..8985e3b 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 9889d76..7872934 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 489ec53..31d59f1 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 7ae0e09..c690d4b 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 aa38cf7..5e0d68e 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 7fa5f2a..bf7fa69 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 0a26f1b..861cf43 100755 Binary files a/binaries/ppc/tpws and b/binaries/ppc/tpws differ diff --git a/binaries/x86/tpws b/binaries/x86/tpws index 134699e..cc512f2 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 cf0d55e..a3a3a8b 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 abd5427..913d467 100644 Binary files a/binaries/x86_64/tpws_wsl.tgz and b/binaries/x86_64/tpws_wsl.tgz differ diff --git a/tpws/tpws_conn.c b/tpws/tpws_conn.c index a1a67b2..ce50884 100644 --- a/tpws/tpws_conn.c +++ b/tpws/tpws_conn.c @@ -756,6 +756,12 @@ static bool handle_proxy_mode(tproxy_conn_t *conn, struct tailhead *conn_list) socks4_send_rep(conn->fd, S4_REP_FAILED); return false; } + if (m->ip==htonl(1)) // special ip 0.0.0.1 + { + VPRINT("socks4a protocol not supported") + socks4_send_rep(conn->fd, S4_REP_FAILED); + return false; + } ss.ss_family = AF_INET; ((struct sockaddr_in*)&ss)->sin_port = m->port; ((struct sockaddr_in*)&ss)->sin_addr.s_addr = m->ip; @@ -810,14 +816,14 @@ static bool handle_proxy_mode(tproxy_conn_t *conn, struct tailhead *conn_list) if (params.no_resolve) { - DBGPRINT("socks5 hostname resolving disabled") + VPRINT("socks5 hostname resolving disabled") socks5_send_rep(conn->fd,S5_REP_NOT_ALLOWED_BY_RULESET); return false; } port=S5_PORT_FROM_DD(m,rd); if (!port) { - DBGPRINT("socks5 no port is given") + VPRINT("socks5 no port is given") socks5_send_rep(conn->fd,S5_REP_HOST_UNREACHABLE); return false; } @@ -830,13 +836,13 @@ static bool handle_proxy_mode(tproxy_conn_t *conn, struct tailhead *conn_list) r=getaddrinfo(sdom,sport,&hints,&ai); if (r) { - DBGPRINT("socks5 getaddrinfo error %d",r) + VPRINT("socks5 getaddrinfo error %d",r) socks5_send_rep(conn->fd,S5_REP_HOST_UNREACHABLE); return false; } 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);