freebsd-ports/net/socks5/files/patch-aa
Warner Losh ba3406cf49 Update to socks 1.0r11. patch-aa had been partially integrated into
r11 as well as parts of patch-ak.  1.0r10 is no longer available at
the NEC web site.  Verified the URL was still the right place to go to
get socks5 1.0r11.

Noticed by: Jim Paterson <jpaterso@paterson.org>
2000-08-30 19:43:28 +00:00

29 lines
1.1 KiB
Text

--- lib/rld.c.orig Wed Aug 4 04:59:28 1999
+++ lib/rld.c Mon Feb 21 03:55:45 2000
@@ -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