Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bugfix: localnet conflicts with proxydns

  • Loading branch information...
commit 6dda28a2c8f32f72f2e857637fcec6d3a24edda7 1 parent 0938a94
Jianing Yang authored March 03, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  src/libproxychains.c
7  src/libproxychains.c
@@ -285,6 +285,7 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) {
285 285
 	struct in_addr *p_addr_in;
286 286
 	unsigned short port;
287 287
 	size_t i;
  288
+	int remote_dns_connect = 0;
288 289
 
289 290
 	if(!init_l)
290 291
 		init_lib();
@@ -302,7 +303,11 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) {
302 303
 	PDEBUG("target: %s\n", inet_ntop(AF_INET, p_addr_in, str, sizeof(str)));
303 304
 	PDEBUG("port: %d\n", port);
304 305
 #endif
305  
-	for(i = 0; i < num_localnet_addr; i++) {
  306
+
  307
+	// check if connect called from proxydns
  308
+	remote_dns_connect = ((p_addr_in->s_addr & 0xff) == remote_dns_subnet);
  309
+
  310
+	for(i = 0; i < num_localnet_addr && !remote_dns_connect; i++) {
306 311
 		if((localnet_addr[i].in_addr.s_addr & localnet_addr[i].netmask.s_addr)
307 312
 		   == (p_addr_in->s_addr & localnet_addr[i].netmask.s_addr)) {
308 313
 			if(localnet_addr[i].port || localnet_addr[i].port == port) {

0 notes on commit 6dda28a

Please sign in to comment.
Something went wrong with that request. Please try again.