From owner-freebsd-hackers Mon May 20 23:15:14 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id XAA00712 for hackers-outgoing; Mon, 20 May 1996 23:15:14 -0700 (PDT) Received: from irbs.irbs.com ([199.182.75.129]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id XAA00707 for ; Mon, 20 May 1996 23:15:10 -0700 (PDT) Received: (from jc@localhost) by irbs.irbs.com (8.7.5/8.6.6) id CAA22689; Tue, 21 May 1996 02:14:26 -0400 (EDT) From: John Capo Message-Id: <199605210614.CAA22689@irbs.irbs.com> Subject: Re: DNS question To: nate@sri.MT.net (Nate Williams) Date: Tue, 21 May 1996 02:14:26 -0400 (EDT) Cc: hackers@FreeBSD.org In-Reply-To: <199605200307.VAA04583@rocky.sri.MT.net> from Nate Williams at "May 19, 96 09:07:58 pm" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Nate Williams writes: > > Name: ns.mt.sri.com > Address: 206.127.76.97 > Aliases: 97.76.127.206.in-addr.arpa > > > gateway:/etc/namedb/new # host 206.127.76.97 > Host not found, try again. > I'll bet you have some log messages that look sort of like this: host: gethostby*.gethostanswer: asked for "131.75.182.199.in-addr.arpa", \ got "131.128.75.182.199.in-addr.arpa" The libc resolver is broken for non-terminal in-addr lookups. *** /usr/stable/src/lib/libc/net/gethostbydns.c Tue Apr 30 22:21:09 1996 --- lib/libc/net/gethostbydns.c Thu May 2 15:57:38 1996 *************** *** 186,192 **** --- 186,194 ---- int haveanswer, had_error; int toobig = 0; char tbuf[MAXDNAME+1]; + const char *tname; + tname = qname; host.h_name = NULL; eom = answer->buf + anslen; /* *************** *** 277,282 **** --- 279,303 ---- buflen -= n; continue; } + if (qtype == T_PTR && type == T_CNAME) { + n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); + if (n < 0) { + had_error++; + continue; + } + cp += n; + /* Get canonical name. */ + n = strlen(tbuf) + 1; /* for the \0 */ + if (n > buflen) { + had_error++; + continue; + } + strcpy(bp, tbuf); + tname = bp; + bp += n; + buflen -= n; + continue; + } if (type != qtype) { /* CNAME->PTR should not cause a log message. */ if (!(qtype == T_PTR && type == T_CNAME)) *************** *** 289,295 **** } switch (type) { case T_PTR: ! if (strcasecmp(qname, bp) != 0) { syslog(LOG_NOTICE|LOG_AUTH, AskedForGot, qname, bp); cp += n; --- 310,316 ---- } switch (type) { case T_PTR: ! if (strcasecmp(tname, bp) != 0) { syslog(LOG_NOTICE|LOG_AUTH, AskedForGot, qname, bp); cp += n; John Capo jc@irbs.com IRBS Engineering FreeBSD Servers and Workstations (954) 792-9551 Unix/Internet Consulting - ISP Solutions