summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/gethostbydns.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-12-01 22:25:38 +0000
committerwollman <wollman@FreeBSD.org>1994-12-01 22:25:38 +0000
commit1504867da7e0ae79c8e140fa173348cd341befef (patch)
treec725def6886d45e4c3bae153e0a8f1ca7f0fba1e /lib/libc/net/gethostbydns.c
parentfc7ab387c24ee0496deacc177ee3a433633fb8e1 (diff)
downloadFreeBSD-src-1504867da7e0ae79c8e140fa173348cd341befef.zip
FreeBSD-src-1504867da7e0ae79c8e140fa173348cd341befef.tar.gz
In _gethostbydnsaddr(), force RES_RECURSE into _res.options. This is
incredibly obnoxious, but also makes inverse mappings work when the local resolver is in a cache-only configuration. (Maybe this is actually a bug in BIND?)
Diffstat (limited to 'lib/libc/net/gethostbydns.c')
-rw-r--r--lib/libc/net/gethostbydns.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index baeceee..110e417 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: gethostbydns.c,v 1.1 1994/09/25 02:12:05 pst Exp $";
+static char rcsid[] = "$Id: gethostbydns.c,v 1.2 1994/09/25 17:45:37 pst Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -431,6 +431,7 @@ _gethostbydnsaddr(addr, len, type)
querybuf buf;
register struct hostent *hp;
char qbuf[MAXDNAME+1];
+ int o_res_options = _res.options;
if (type != AF_INET)
return (NULL);
@@ -439,7 +440,9 @@ _gethostbydnsaddr(addr, len, type)
((unsigned)addr[2] & 0xff),
((unsigned)addr[1] & 0xff),
((unsigned)addr[0] & 0xff));
+ _res.options |= RES_RECURSE;
n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf.buf, sizeof buf.buf);
+ _res.options = o_res_options;
if (n < 0) {
if (_res.options & RES_DEBUG)
printf("res_query failed\n");
OpenPOWER on IntegriCloud