mirror of
https://github.com/haad/proxychains.git
synced 2026-09-13 18:45:50 +05:00
Merge pull request #15 from jianingy/master
bugfix: localnet conflicts with proxydns
This commit is contained in:
commit
4d40a4790f
10
Makefile
10
Makefile
@ -17,7 +17,7 @@ SRCS = $(sort $(wildcard src/*.c))
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
LOBJS = src/core.o src/libproxychains.o
|
||||
|
||||
CCFLAGS = -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DTHREAD_SAFE -Werror
|
||||
CCFLAGS = -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DTHREAD_SAFE -Werror
|
||||
LDFLAGS = -shared -fPIC -ldl -lpthread
|
||||
INC =
|
||||
PIC = -fPIC
|
||||
@ -46,10 +46,10 @@ all: $(ALL_LIBS) $(ALL_TOOLS)
|
||||
|
||||
#install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(DESTDIR)$(LDSO_PATHNAME)
|
||||
install:
|
||||
install -d $(bindir) $(libdir) $(confdir) $(includedir)
|
||||
install $(INSTALL_FLAGS) 755 $(ALL_TOOLS) $(bindir)/
|
||||
install $(INSTALL_FLAGS) 644 $(ALL_LIBS) $(libdir)/
|
||||
install $(INSTALL_FLAGS) 644 src/proxychains.conf $(confdir)
|
||||
install -d $(DESTDIR)/$(bindir) $(DESTDIR)/$(libdir) $(DESTDIR)/$(confdir) $(DESTDIR)/$(includedir)
|
||||
install $(INSTALL_FLAGS) 755 $(ALL_TOOLS) $(DESTDIR)/$(bindir)/
|
||||
install $(INSTALL_FLAGS) 644 $(ALL_LIBS) $(DESTDIR)/$(libdir)/
|
||||
install $(INSTALL_FLAGS) 644 src/proxychains.conf $(DESTDIR)/$(confdir)
|
||||
|
||||
clean:
|
||||
rm -f $(ALL_LIBS)
|
||||
|
||||
@ -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 = (ntohl(p_addr_in->s_addr) >> 24 == 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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user