Browse Source

tpws: check for sock4a protocol

pull/105/head
bol-van 3 years ago
parent
commit
dd1ba8218d
  1. BIN
      binaries/aarch64/tpws
  2. BIN
      binaries/arm/tpws
  3. BIN
      binaries/freebsd-x64/tpws
  4. BIN
      binaries/mac64/tpws
  5. BIN
      binaries/mips32r1-lsb/tpws
  6. BIN
      binaries/mips32r1-msb/tpws
  7. BIN
      binaries/mips64r2-msb/tpws
  8. BIN
      binaries/ppc/tpws
  9. BIN
      binaries/x86/tpws
  10. BIN
      binaries/x86_64/tpws
  11. BIN
      binaries/x86_64/tpws_wsl.tgz
  12. 14
      tpws/tpws_conn.c

BIN
binaries/aarch64/tpws

Binary file not shown.

BIN
binaries/arm/tpws

Binary file not shown.

BIN
binaries/freebsd-x64/tpws

Binary file not shown.

BIN
binaries/mac64/tpws

Binary file not shown.

BIN
binaries/mips32r1-lsb/tpws

Binary file not shown.

BIN
binaries/mips32r1-msb/tpws

Binary file not shown.

BIN
binaries/mips64r2-msb/tpws

Binary file not shown.

BIN
binaries/ppc/tpws

Binary file not shown.

BIN
binaries/x86/tpws

Binary file not shown.

BIN
binaries/x86_64/tpws

Binary file not shown.

BIN
binaries/x86_64/tpws_wsl.tgz

Binary file not shown.

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

Loading…
Cancel
Save