diff --git a/Makefile b/Makefile index 481d904..a814539 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,8 @@ sysconfdir=$(prefix)/etc SRCS = $(sort $(wildcard src/*.c)) OBJS = $(SRCS:.c=.o) -LOBJS = src/core.o src/common.o src/libproxychains.o src/shm.o \ +LOBJS = src/nameinfo.o \ + src/core.o src/common.o src/libproxychains.o src/shm.o \ src/allocator_thread.o src/ip_type.o src/stringdump.o \ src/hostentdb.o src/hash.o diff --git a/src/libproxychains.c b/src/libproxychains.c index 41b193b..d1ecd47 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -381,22 +381,16 @@ void freeaddrinfo(struct addrinfo *res) { return; } -// work around a buggy prototype in GLIBC. according to the bugtracker it has been fixed in git at 02 May 2011. -// 2.14 came out in June 2011 so that should be the first fixed version -#if defined(__GLIBC__) && (__GLIBC__ < 3) && (__GLIBC_MINOR__ < 14) -int getnameinfo(const struct sockaddr *sa, - socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags) -#else -int getnameinfo(const struct sockaddr *sa, - socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags) -#endif +int pc_getnameinfo(const struct sockaddr *sa, socklen_t salen, + char *host, socklen_t hostlen, char *serv, + socklen_t servlen, int flags) { char ip_buf[16]; int ret = 0; INIT(); - PDEBUG("getnameinfo: %s %s\n", host, serv); + PFUNC(); if(!proxychains_resolver) { ret = true_getnameinfo(sa, salen, host, hostlen, serv, servlen, flags); diff --git a/src/nameinfo.c b/src/nameinfo.c new file mode 100644 index 000000000..2a532a2 --- /dev/null +++ b/src/nameinfo.c @@ -0,0 +1,13 @@ +#include + +extern int pc_getnameinfo(const void *sa, socklen_t salen, + char *host, socklen_t hostlen, char *serv, + socklen_t servlen, int flags); + + +int getnameinfo(const void *sa, socklen_t salen, + char *host, socklen_t hostlen, char *serv, + socklen_t servlen, int flags) { + return pc_getnameinfo(sa, salen, host, hostlen, serv, servlen, flags); +} +