From 063ac681da84fd6e21c131e9fbf0407a2dcf822b Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 12 Dec 2021 17:51:25 +0000 Subject: [PATCH] remove 10 year old workaround for wrong glibc getnameinfo signature in ce655fdac82ed843b94a1f1a176475e9dbe432c1 the getnameinfo function was factored into a separate TU to prevent its POSIX signature from colliding with GLIBC's wrong prototype. since this has been fixed in GLIBC 10 years ago, it should be safe by now. undoing the workaround has the advantage that all hooked functions are now available in the same place, which is a prerequisite for a change i'm about to commit. if it turns out there's still systems in use that use the old GLIBC version with the wrong prototype, we can add a configure check dealing with it. --- Makefile | 2 +- src/libproxychains.c | 2 +- src/nameinfo.c | 13 ------------- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 src/nameinfo.c diff --git a/Makefile b/Makefile index 7f3f4fa..7483ffe 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ DOBJS = src/daemon/hsearch.o \ src/daemon/sblist.o src/daemon/sblist_delete.o \ src/daemon/daemon.o src/daemon/udpserver.o -LOBJS = src/nameinfo.o src/version.o \ +LOBJS = src/version.o \ src/core.o src/common.o src/libproxychains.o \ src/allocator_thread.o src/rdns.o \ src/hostsreader.o src/hash.o src/debug.o diff --git a/src/libproxychains.c b/src/libproxychains.c index b67ce83..f3e799c 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -689,7 +689,7 @@ void freeaddrinfo(struct addrinfo *res) { proxy_freeaddrinfo(res); } -int pc_getnameinfo(const struct sockaddr *sa, socklen_t salen, +int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags) { diff --git a/src/nameinfo.c b/src/nameinfo.c deleted file mode 100644 index 2a532a2..000000000 --- a/src/nameinfo.c +++ /dev/null @@ -1,13 +0,0 @@ -#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); -} -