diff options
author | wpaul <wpaul@FreeBSD.org> | 1996-12-24 02:10:24 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1996-12-24 02:10:24 +0000 |
commit | 4ab0d63c8aed49b7d37e4c8f3557febdad48a701 (patch) | |
tree | cfce9912d4c66d2d89777ca40062d8f6f2c30d35 /lib/libc/net/gethostbydns.c | |
parent | 010a4ef701b1e3905afc01e958ccee730a120db2 (diff) | |
download | FreeBSD-src-4ab0d63c8aed49b7d37e4c8f3557febdad48a701.zip FreeBSD-src-4ab0d63c8aed49b7d37e4c8f3557febdad48a701.tar.gz |
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. :)
Diffstat (limited to 'lib/libc/net/gethostbydns.c')
-rw-r--r-- | lib/libc/net/gethostbydns.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 573ba34..415bc49 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 <sys/types.h> @@ -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)); } |