Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2012-12-25 22:08:05 +0400
committerrofl0r <retnyg@gmx.net>2012-12-25 22:08:05 +0400
commit5526afb56d7dea71a1bfda8db7dbd0c9e9dd3753 (patch)
treef0732d1735e7069aecfc37f7d29d96ee85934e9b
parentbe4efc0fd53a451919c6870819b64212e8e8e09f (diff)
FreeBSD supportv4.4
-rw-r--r--Makefile3
-rwxr-xr-xconfigure9
-rw-r--r--src/hostentdb.c5
3 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6b6b2f2..b5bbd58 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,8 @@ LOBJS = src/nameinfo.o \
CFLAGS += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe
NO_AS_NEEDED = -Wl,--no-as-needed
-LDFLAGS = -shared -fPIC $(NO_AS_NEEDED) -ldl -lpthread
+LIBDL = -ldl
+LDFLAGS = -shared -fPIC $(NO_AS_NEEDED) $(LIBDL) -lpthread
INC =
PIC = -fPIC
AR = $(CROSS_COMPILE)ar
diff --git a/configure b/configure
index d1c281e..952a207 100755
--- a/configure
+++ b/configure
@@ -34,7 +34,11 @@ parsearg() {
}
ismac() {
- uname -s | grep Darwin
+ uname -s | grep Darwin >/dev/null
+}
+
+isbsd() {
+ uname -s | grep BSD >/dev/null
}
while true ; do
@@ -83,6 +87,9 @@ if ismac ; then
echo MAC_CFLAGS+=-DIS_MAC=1>>config.mak
echo LD_SET_SONAME=-Wl,-install_name,>>config.mak
echo INSTALL_FLAGS=-m>>config.mak
+elif isbsd ; then
+ echo LIBDL=>>config.mak
+ echo "CFLAGS+=-DIS_BSD">>config.mak
fi
echo done, now run make \&\& make install
diff --git a/src/hostentdb.c b/src/hostentdb.c
index 337e26c..488e983 100644
--- a/src/hostentdb.c
+++ b/src/hostentdb.c
@@ -28,11 +28,16 @@ static void hdb_add(struct hostent_list* hl, char* host, ip_type ip) {
}
static void hdb_fill(struct hostent_list *hl) {
+#ifndef IS_BSD
struct hostent* hp;
while((hp = gethostent()))
if(hp->h_addrtype == AF_INET && hp->h_length == sizeof(in_addr_t)) {
hdb_add(hl, hp->h_name, (ip_type) { .as_int = *((in_addr_t*)(hp->h_addr_list[0])) });
}
+#else
+ /* FreeBSD hangs on gethostent(). since this feature is not crucial, we just do nothing */
+ (void) hl;
+#endif
}
void hdb_init(struct hostent_list *hl) {