diff options
author | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-02-24 06:37:27 +0000 |
---|---|---|
committer | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-02-24 06:37:27 +0000 |
commit | e53d640ca4cee704108d4f31f410b5aa43eb6359 (patch) | |
tree | 0e075cba8c28f79559cf3b2c9602b4be74c0d2fe /net/socks5/files/patch-aa | |
parent | Separete two ports in point of LIB_DEPENDS. (diff) |
Add getaddrinfo() wrapper function support.
Tested and confirmed by: Robert Muir <rmuir@looksharp.net>,
Toshihiko Kodama <kodama@ayame.mfd.cs.fujitsu.co.jp>,
Masahide -mac- NODA <mac@clave.gr.jp>
Approved by: jkh
Reviewed by: imp
Diffstat (limited to 'net/socks5/files/patch-aa')
-rw-r--r-- | net/socks5/files/patch-aa | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/net/socks5/files/patch-aa b/net/socks5/files/patch-aa index 393eee3f9f6d..87cc2585803e 100644 --- a/net/socks5/files/patch-aa +++ b/net/socks5/files/patch-aa @@ -1,6 +1,6 @@ ---- lib/rld.c.org Wed Jun 24 22:32:37 1998 -+++ lib/rld.c Wed Jun 24 22:33:11 1998 -@@ -140,7 +140,7 @@ +--- lib/rld.c.orig Wed Aug 4 04:59:28 1999 ++++ lib/rld.c Mon Feb 21 03:55:45 2000 +@@ -143,7 +143,7 @@ static void DGetOriginalFunc(void **fptr, char *name, int libmask) { /* Synchronize access to func and lib opening functions if we can... */ @@ -9,3 +9,30 @@ name++; #endif +@@ -197,6 +197,26 @@ + lsInRLDFunctions = 0; + S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0, "RLD: gethostbyname2 results: %s %s", name, hp?hp->h_name:"???"); + return hp; ++} ++#endif ++ ++#ifdef HAVE_GETADDRINFO ++int REAL(getaddrinfo)(const char *hostname, const char *servname, ++ const struct addrinfo *hints, struct addrinfo **aip) { ++ int error; ++ static void *func = NULL; ++ ++ S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0, "RLD: getaddrinfo: %s", hostname); ++ GetOriginalFunc(&func, "_getaddrinfo", TRY_LIBC | TRY_LIBNSL | TRY_LIBRESOLV); ++ if (!func || func == (void *)-1) return NULL; ++ ++ lsInRLDFunctions = 1; ++ error = ((int (*)P((const char *, const char *, const struct addrinfo *, ++ struct addrinfo **)))func)(hostname, servname, ++ hints, aip); ++ lsInRLDFunctions = 0; ++ S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0, "RLD: getaddrinfo results: %s %s", hostname, (*aip&&(*aip)->ai_canonname)?(*aip)->ai_canonname:"???"); ++ return error; + } + #endif + |