From 6b73680dcfa2adab01b30afdd158e8f0157a66ef Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 24 Dec 1996 02:10:24 +0000 Subject: Make the __dns_getanswer() wrapper work right. For the newer versions of BIND, we need to tweak some things to that gethostanswer() knows whether or not we're dealing with an IPv4 or IPv6 address. (This'll teach me to use a 2.1.0 system for NIS development -- but it's so nice and stable I just can't being myself to upgrade it. :) --- lib/libc/net/gethostbydns.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib/libc/net') diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 573ba3432095..415bc4914cfa 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.12 1996/11/01 06:25:43 peter Exp $"; +static char rcsid[] = "$Id: gethostbydns.c,v 1.13 1996/12/22 22:05:43 wpaul Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -404,6 +404,19 @@ __dns_getanswer(answer, anslen, qname, qtype) const char *qname; int qtype; { + switch(qtype) { + case T_AAAA: + host.h_addrtype = AF_INET6; + host.h_length = IN6ADDRSZ; + break; + case T_A: + default: + host.h_addrtype = AF_INET; + host.h_length = INADDRSZ; + break; + return(NULL); + } + return(gethostanswer((const querybuf *)answer, anslen, qname, qtype)); } -- cgit v1.3