From 40569757cc68ff389c3dfccb47b9fdca4f8fa124 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Thu, 1 Dec 1994 22:25:38 +0000 Subject: 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?) --- lib/libc/net/gethostbydns.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libc/net/gethostbydns.c') diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index baeceeeb927a..110e4172f34b 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 @@ -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"); -- cgit v1.2.3