Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bugfix: localnet conflicts with proxydns

  • Loading branch information...
commit 6dda28a2c8f32f72f2e857637fcec6d3a24edda7 1 parent 0938a94
Jianing Yang authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/libproxychains.c
7 src/libproxychains.c
View
@@ -285,6 +285,7 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) {
struct in_addr *p_addr_in;
unsigned short port;
size_t i;
+ int remote_dns_connect = 0;
if(!init_l)
init_lib();
@@ -302,7 +303,11 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) {
PDEBUG("target: %s\n", inet_ntop(AF_INET, p_addr_in, str, sizeof(str)));
PDEBUG("port: %d\n", port);
#endif
- for(i = 0; i < num_localnet_addr; i++) {
+
+ // check if connect called from proxydns
+ remote_dns_connect = ((p_addr_in->s_addr & 0xff) == remote_dns_subnet);
+
+ for(i = 0; i < num_localnet_addr && !remote_dns_connect; i++) {
if((localnet_addr[i].in_addr.s_addr & localnet_addr[i].netmask.s_addr)
== (p_addr_in->s_addr & localnet_addr[i].netmask.s_addr)) {
if(localnet_addr[i].port || localnet_addr[i].port == port) {
Please sign in to comment.
Something went wrong with that request. Please try again.