A6/DNAME/bitstring label cleansing from BIND8 resolver

Jun-ichiro itojun Hagino itojun at iijlab.net
Wed Sep 4 23:52:12 UTC 2002


>	based on bind 9.3.0s20020722 lib/bind.

	more cleansing, avoids A6 lookups.

itojun


diff -u -r work.i386-/bind-9.3.0s20020722/lib/bind/include/resolv.h work.i386/bind-9.3.0s20020722/lib/bind/include/resolv.h
--- work.i386-/bind-9.3.0s20020722/lib/bind/include/resolv.h	Fri Jun 28 14:46:10 2002
+++ work.i386/bind-9.3.0s20020722/lib/bind/include/resolv.h	Thu Sep  5 08:44:46 2002
@@ -247,12 +247,9 @@
 #define	RES_KEEPTSIG	0x00010000	/* do not strip TSIG records */
 #define	RES_BLAST	0x00020000	/* blast all recursive servers */
 #define RES_NO_NIBBLE	0x00040000	/* disable IPv6 nibble mode reverse */
-#define RES_NO_BITSTRING 0x00080000	/* disable IPv6 bitstring mode reverse */
 #define RES_NOTLDQUERY	0x00100000	/* don't unqualified name as a tld */
 #define RES_USE_DNSSEC	0x00200000	/* use DNSSEC using OK bit in OPT */
 /* KAME extensions: use higher bit to avoid conflict with ISC use */
-#define RES_USE_DNAME	0x10000000	/* use DNAME */
-#define RES_USE_A6	0x20000000	/* use A6 */
 #define RES_USE_EDNS0	0x40000000	/* use EDNS0 if configured */
 #define RES_NO_NIBBLE2	0x80000000	/* disable alternate nibble lookup */
 
@@ -471,7 +468,6 @@
 void		res_buildprotolist __P((void));
 const char *	res_get_nibblesuffix __P((res_state));
 const char *	res_get_nibblesuffix2 __P((res_state));
-const char *	res_get_bitstringsuffix __P((res_state));
 void		res_ndestroy __P((res_state));
 u_int16_t	res_nametoclass __P((const char *buf, int *success));
 u_int16_t	res_nametotype __P((const char *buf, int *success));
diff -u -r work.i386-/bind-9.3.0s20020722/lib/bind/irs/dns_ho.c work.i386/bind-9.3.0s20020722/lib/bind/irs/dns_ho.c
--- work.i386-/bind-9.3.0s20020722/lib/bind/irs/dns_ho.c	Fri Jun 28 15:12:42 2002
+++ work.i386/bind-9.3.0s20020722/lib/bind/irs/dns_ho.c	Thu Sep  5 08:49:27 2002
@@ -172,15 +172,6 @@
 				   const struct addrinfo *pai);
 static int add_hostent(struct pvt *pvt, char *bp, char **hap,
 		       struct addrinfo *ai);
-static const u_char * ar_head(const u_char *, int, const u_char *,
-			      const u_char *, struct pvt *,
-			      int (*)(const char *));
-static struct addrinfo * a6_expand(const u_char *, const u_char *, int,
-				   const u_char *, const u_char *,
-				   const struct in6_addr *, int,
-				   const struct addrinfo *,
-				   struct pvt *, int (*)(const char *), int *);
-static const char *dname_subst(const char *, const char *, const char *);
 static int		init(struct irs_ho *this);
 
 /* Exports. */
@@ -285,21 +276,10 @@
 	case AF_INET6:
 		size = IN6ADDRSZ;
 		q->qclass = C_IN;
-		q->qtype = ns_t_a6;
+		q->qtype = T_AAAA;
 		q->answer = q->qbuf.buf;
 		q->anslen = sizeof(q->qbuf);
-		q->next = q2;
-#ifdef RES_USE_A6
-		if ((pvt->res->options & RES_USE_A6) == 0)
-			q->action = RESTGT_IGNORE;
-		else
-#endif
-			q->action = RESTGT_DOALWAYS;
-		q2->qclass = C_IN;
-		q2->qtype = T_AAAA;
-		q2->answer = q2->qbuf.buf;
-		q2->anslen = sizeof(q2->qbuf);
-		q2->action = RESTGT_AFTERFAILURE;
+		q->action = RESTGT_DOALWAYS;
 		break;
 	default:
 		RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
@@ -589,28 +569,15 @@
 	case AF_UNSPEC:
 		/* prefer IPv6 */
 		q->qclass = C_IN;
-		q->qtype = ns_t_a6;
+		q->qtype = T_AAAA;
 		q->answer = q->qbuf.buf;
 		q->anslen = sizeof(q->qbuf);
 		q->next = q2;
-#ifdef RES_USE_A6
-		if ((pvt->res->options & RES_USE_A6) == 0)
-			q->action = RESTGT_IGNORE;
-		else
-#endif
-			q->action = RESTGT_DOALWAYS;
+		q->action = RESTGT_DOALWAYS;
 		q2->qclass = C_IN;
-		q2->qtype = T_AAAA;
+		q2->qtype = T_A;
 		q2->answer = q2->qbuf.buf;
 		q2->anslen = sizeof(q2->qbuf);
-		q2->next = q3;
-		/* try AAAA only when A6 query fails */
-		q2->action = RESTGT_AFTERFAILURE;
-		q3->qclass = C_IN;
-		q3->qtype = T_A;
-		q3->answer = q3->qbuf.buf;
-		q3->anslen = sizeof(q3->qbuf);
-		q3->action = RESTGT_DOALWAYS;
 		break;
 	case AF_INET:
 		q->qclass = C_IN;
@@ -621,21 +588,10 @@
 		break;
 	case AF_INET6:
 		q->qclass = C_IN;
-		q->qtype = ns_t_a6;
+		q->qtype = T_AAAA;
 		q->answer = q->qbuf.buf;
 		q->anslen = sizeof(q->qbuf);
-		q->next = q2;
-#ifdef RES_USE_A6
-		if ((pvt->res->options & RES_USE_A6) == 0)
-			q->action = RESTGT_IGNORE;
-		else
-#endif
-			q->action = RESTGT_DOALWAYS;
-		q2->qclass = C_IN;
-		q2->qtype = T_AAAA;
-		q2->answer = q2->qbuf.buf;
-		q2->anslen = sizeof(q2->qbuf);
-		q2->action = RESTGT_AFTERFAILURE;
+		q->action = RESTGT_DOALWAYS;
 		break;
 	default:
 		RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); /* better error? */
@@ -693,370 +649,6 @@
 	return(sentinel.ai_next);
 }
 
-static const u_char *
-ar_head(cp, count, msg, eom, pvt, name_ok)
-	const u_char *cp, *msg, *eom;
-	int count;
-	struct pvt *pvt;
-	int (*name_ok)(const char *);
-{
-	int n;
-	char buf[1024];	/* XXX */
-
-	while (count-- > 0 && cp < eom) {
-		n = dn_expand(msg, eom, cp, buf, sizeof(buf));
-		if (n < 0 || !maybe_ok(pvt->res, buf, name_ok))
-			goto end;
-		cp += n;			/* name */
-		if (cp + 3 * INT16SZ + INT32SZ >= eom)
-			goto end;
- 		cp += INT16SZ;			/* type */
- 		cp += INT16SZ + INT32SZ;	/* class, TTL */
-		n = ns_get16(cp);
-		cp += n + INT16SZ;		/* len */
-	}
-	return(cp);
-
-  end:
-	return(eom);		/* XXX */
-}
-
-/* XXX: too many arguments */
-static struct addrinfo *
-a6_expand(const u_char *ansbuf, const u_char *a6p,
-	  int a6len, const u_char *arp, const u_char *eom,
-	  const struct in6_addr *in6, int plen, const struct addrinfo *pai,
-	  struct pvt *pvt, int (*name_ok)(const char *), int *errorp)
-{
-	struct in6_addr a;
-	int n, pbyte, plen1, pbyte1, error = 0;
-	const u_char *cp;
-	struct addrinfo sentinel, *cur;
-	char pname[1024], buf[1024]; /* XXX */
-
-	*errorp = NETDB_SUCCESS;
-	memset(&sentinel, 0, sizeof(sentinel));
-	cur = &sentinel;
-
-	/*
-	 * Validate A6 parameters.
-	 */
-	if (a6len == 0) { /* an A6 record must contain at least 1 byte. */
-		error = NO_RECOVERY;
-		goto bad;
-	}
-	/* prefix length check. */
-	if ((plen1 = *a6p) > 128) {
-		error = NO_RECOVERY;
-		goto bad;
-	}
-	if (plen1 > plen) {
-		/*
-		 * New length must not be greater than old one.
-		 * Ignore the record as specified in RFC 2874
-		 * Section 3.1.2.
-		 */
-		return(NULL); /* just ignore. */
-	}
-	/* boundary check for new plen and prefix addr */
-	pbyte1 = (plen1 & ~7) / 8;
-	if ((int)sizeof(struct in6_addr) - pbyte1 > a6len - 1) {
-		error = NO_RECOVERY;
-		goto bad;
-	}
-
-	/*
-	 * merge the new prefix portion.
-	 * <--- plen(bits) --->
-	 * <--- pbyte ---><-b->
-	 * 000000000000000pppppxxxxxxxxxxx(= in6, 0: unknown, x: known, p: pad)
-	 *           PP++++++++(+ should be merged. P: padding, must be 0)
-	 * <-- plen1-->
-	 * <-pbyte1->
-	 *           ^a6p+1
-	 * The result should be:
-	 * 0000000000PP++++++++xxxxxxxxxxx(= a)
-	 */
-	pbyte = (plen & ~7) / 8;
-	a = *in6;
-	if (pbyte > pbyte1) {
-		/* N.B. the case of "pbyte1 == 128" is implicitly excluded. */
-		int b = plen % 8; /* = the length of "pp..." above */
-		u_char c_hi, c_lo;
-
-		memcpy(&a.s6_addr[pbyte1], a6p + 1, pbyte - pbyte1);
-		if (b > 0) {
-			c_hi = a6p[pbyte - pbyte1 + 1];
-			c_lo = in6->s6_addr[pbyte];
-			a.s6_addr[pbyte] =
-				(c_hi & (0xff << (8 - b))) |
-				((0x00ff >> b) & c_lo);
-		}
-	}
-
-#if 0				/* for debug */
-	if ((pvt->res->options & RES_DEBUG) != 0) {
-		u_char ntopbuf[INET6_ADDRSTRLEN];
-
-		inet_ntop(AF_INET6, &a, ntopbuf, sizeof(ntopbuf));
-		printf("a6_expand: %s\\%d\n", ntopbuf, plen1);
-	}
-#endif
-
-	if (plen1 == 0) {
-		/* Here is the end of A6 chain. make addrinfo, then return. */
-		return(addr2addrinfo(pai, (const char *)&a));
-	}
-
-	/*
-	 * Expand the new prefix name. Since the prefix name must not be
-	 * compressed (RFC 2874 Section 3.1.1), we could use ns_name_ntop()
-	 * here if it had a stricter boundary check.
-	 */
-	cp = a6p + 1 + (sizeof(*in6) - pbyte1);
-	n = dn_expand(ansbuf, eom, cp, pname, sizeof(pname));
-	if (n < 0 || !maybe_ok(pvt->res, pname, name_ok)) {
-		error = NO_RECOVERY;
-		goto bad;
-	}
-	if (cp + n != a6p + a6len) { /* length mismatch */
-		error = NO_RECOVERY;
-		goto bad;
-	}
-
-	/*
-	 * we need (more) additional section records, but no one is
-	 * available, which possibly means a malformed answer.
-	 */
-	if (arp == NULL) {
-		error = NO_RECOVERY; /* we can't resolve the chain. */
-		goto bad;
-	}
-
-	/*
-	 * Loop thru the rest of the buffer, searching for the next A6 record
-	 * that has the same owner name as the prefix name. If found, then
-	 * recursively call this function to expand the whole A6 chain.
-	 */
-	plen = plen1;
-	for (cp = arp; cp != NULL && cp < eom; cp += n) {
-		int class, type;
-
-		n = dn_expand(ansbuf, eom, cp, buf, sizeof(buf));
-		if (n < 0 || !maybe_ok(pvt->res, buf, name_ok)) {
-			error = NO_RECOVERY;
-			goto bad;
-		}
-		cp += n;			/* name */
-		if (cp + 3 * INT16SZ + INT32SZ > eom) {
-			error = NO_RECOVERY;
-			goto bad;
-		}
-		type = ns_get16(cp);
-		cp += INT16SZ;			/* type */
-		class = ns_get16(cp);
-		cp += INT16SZ + INT32SZ;	/* class, TTL */
-		n = ns_get16(cp);
-		cp += INT16SZ;			/* len */
-		if (cp + n > eom) {
-			error = NO_RECOVERY;
-			goto bad;
-		}
-		if (class != C_IN || type != ns_t_a6) {
-			/* we are only interested in A6 records. skip others */
-			continue;
-		}
-
-		if (ns_samename(buf, pname) != 1) {
-			continue;
-		}
-
-		/* Proceed to the next record in the chain. */
-		cur->ai_next = a6_expand(ansbuf, cp, n, cp + n, eom,
-					 (const struct in6_addr *)&a,
-					 plen, pai, pvt, name_ok, &error);
-		if (error != NETDB_SUCCESS)
-			goto bad;
-		while (cur && cur->ai_next)
-			cur = cur->ai_next;
-	}
-
-	return(sentinel.ai_next);
-
-  bad:
-	*errorp = error;
-	if (sentinel.ai_next)
-		freeaddrinfo(sentinel.ai_next);
-	return(NULL);
-}
-
-static const char *
-dname_subst(const char *qname0, const char *owner0, const char *target) {
-	char owner[MAXDNAME];
-	static char qname[MAXDNAME];
-	const char blabelhead[] = "\\[x"; /* we can assume hex strings */
-	int qlen, olen;
-	int bufsiz = sizeof(qname);
-
-	/* make local copies, which are canonicalized. */
-	if (ns_makecanon(qname0, qname, sizeof(qname)) < 0 ||
-	    ns_makecanon(owner0, owner, sizeof(owner)) < 0)
-		return(NULL);
-	qlen = strlen(qname);
-	olen = strlen(owner);
-	/* from now on, do not refer to qname0 nor owner0. */
-
-	/*
-	 * check if QNAME is a subdomain of OWNER.
-	 * XXX: currently, we only handle the following two cases:
-	 *      (A) none of the labels are bitlabels, or
-	 *      (B) both of the head labels are bitlabels (and the following
-	 *          labels are NOT bitlabels).
-	 * If we pass the check, then subtract the remaining part from QNAME.
-	 * ex. (A) qname=www.foo.com,owner=foo.com => new qname=www.
-	 *     (B) qname=\[x3ffe0501/32].foo.com,owner=\[x3ffe/16].foo.com
-	 *                                  => new qname=\[x0501/16].
-	 */
-	if (ns_samedomain(qname, owner)) { /* check (A) */
-		/* at this point, qlen must not be smaller than olen */
-		qname[qlen - olen] = 0;
-		bufsiz -= (qlen - olen);
-	} else {		/* check (B) */
-		char *parent0, *parent1;
-		/* the following 3 have enough size to store 1 bitlabel */
-		u_char qlabel[64], olabel[64], newlabel[64];
-		int qlabellen, olabellen;
-
-		if (strncmp(qname, blabelhead, 3) != 0 ||
-		    strncmp(owner, blabelhead, 3) != 0)
-			return(NULL);
-		/*
-		 * Both two begin with bitlabels. The succeeding parts
-		 * must exact match.
-		 */
-		if ((parent0 = strchr(qname, '.')) == NULL ||
-		    (parent1 = strchr(owner, '.')) == NULL)
-			return(NULL);
-
-		/* ns_samename allows names to begin with '.' */
-		if (ns_samename(parent0, parent1) != 1)
-			return(NULL);
-
-		/* cut the upper domain parts off. */
-		*(parent0 + 1) = 0;
-		*(parent1 + 1) = 0;
-		/* convert the textual form into binary one. */
-		if (ns_name_pton(qname, qlabel, sizeof(qlabel)) < 0 ||
-		    ns_name_pton(owner, olabel, sizeof(olabel)) < 0)
-			return(NULL);
-		if ((qlabellen = *(qlabel + 1)) == 0)
-			qlabellen = 256;
-		if ((olabellen = *(olabel + 1)) == 0)
-			olabellen = 256;
-		if (olabellen > qlabellen)
-			return(NULL); /* owner does not contain qname. */
-		else {
-			int qplen = (qlabellen + 7) / 8;
-			int oplen = (olabellen + 7) / 8;
-			int sft = olabellen % 8;
-			int nllen, n;
-			u_char *qp, *op, *np;
-
-			/* skip ELT and Count. */
-			qp = qlabel + 2;
-			op = olabel + 2;
-
-			/* check if olabel is a "subdomain" of qlabel. */
-			if (memcmp(qp, op, oplen - 1) != 0)
-				return(NULL);
-			if (sft > 0) {
-				/* compare trailing bits (between 1 and 7) */
-				if ((qp[qplen - 1] & (0xff << sft)) !=
-				    op[qplen - 1])
-					return(NULL);
-			}
-
-			/* OK, get remaining bits from qlabel. */
-			np = newlabel;
-			if (olabellen == qlabellen) {
-				/*
-				 * Two names (including bitlabels) are exactly
-				 * same. Discard the whole names.
-				 * XXX: ns_samename() above should exclude
-				 * this case...
-				 */
-				qname[0] = 0;
-				goto maketarget;
-			}
-			*np++ = 0x41; /* XXX hardcoding */
-			*np++ = nllen = (qlabellen - olabellen);
-			if (sft == 0) {
-				/*
-				 * No alignment issue. can just use memcpy.
-				 * Note that the "else" part below contains
-				 * this case. We separate the two cases just
-				 * for efficiency.
-				 * We assume that ns_name_pton above ensures
-				 * QP does not contain trailing garbages.
-				 */
-				memcpy(np, qp + oplen, qplen - oplen);
-				np += qplen - oplen;
-				*np = 0;
-			} else {
-				/*
-				 * copy the lower (8-SFT) bits of QP to the
-				 * upper (8-SFT) bits of NP, then copy the
-				 * upper SFT bits of QP+1 to the lower SFT bits
-				 * of NP, and so on...
-				 * if QP is       xxxyyyyy zzzwww..., then
-				 *    NP would be yyyyyzzz ...
-				 * Again, we assume QP does not contain
-				 * trailing garbages.
-				 */
-				qp += (oplen - 1);
-				while (nllen > 0) {
-					*np = (*qp << sft) & 0xff;
-					if ((nllen -= (8 - sft)) <= 0)
-						break; /* done */
-					qp++;
-					*np |= ((*qp >> sft) & 0xff);
-					np++;
-					nllen -= sft;
-				}
-				*++np = 0;
-			}
-
-			/*
-			 * make a new bitlabel with the remaining bits.
-			 * Note that there's no buffer boundary issue, since
-			 * qlabel, olabel, and newlabel all have the same size.
-			 * ns_name_ntop() must not return 0, since we have
-			 * a non-empty bitlabel.
-			 */
-			if ((n = ns_name_ntop(newlabel, qname, sizeof(qname)))
-			     <= 0)
-				return(NULL);
-			bufsiz -= n;
-			if (qname[n - 1] != '.') { /* XXX no trailing dot */
-				qname[n - 1] = '.';
-				qname[n] = 0;
-				bufsiz--;
-			}
-
-		}
-	}
-
-  maketarget:
-	/*
-	 * Finally, append the remaining part (maybe empty) to the new target.
-	 */
-	if (bufsiz < (int)strlen(target)) /* bufsiz takes care of the \0. */
-		return(NULL);
-	strcat(qname, target);
-
-	return((const char *)qname);
-}
-
 static void
 ho_res_set(struct irs_ho *this, struct __res_state *res,
 		void (*free_res)(void *)) {
@@ -1092,7 +684,6 @@
 	char *bp, *ep, **ap, **hap;
 	char tbuf[MAXDNAME+1];
 	struct addrinfo sentinel, *cur, ai;
-	const u_char *arp = NULL;
 
 	if (pai == NULL) abort();
 	if (ret_aip != NULL)
@@ -1103,7 +694,6 @@
 	tname = qname;
 	eom = ansbuf + anslen;
 	switch (qtype) {
-	case ns_t_a6:
 	case T_A:
 	case T_AAAA:
 	case T_ANY:	/* use T_ANY only for T_A/T_AAAA lookup */
@@ -1148,8 +738,7 @@
 		RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
 		return (NULL);
 	}
-	if (qtype == T_A || qtype == T_AAAA ||
-	    qtype == ns_t_a6 || qtype == T_ANY) {
+	if (qtype == T_A || qtype == T_AAAA || qtype == T_ANY) {
 		/* res_nsend() has already verified that the query name is the
 		 * same as the one we sent; this just gets the expanded name
 		 * (i.e., with the succeeding search-domain tacked on).
@@ -1193,7 +782,7 @@
 			continue;
 		}
 		eor = cp + n;
-		if ((qtype == T_A || qtype == T_AAAA || qtype == ns_t_a6 ||
+		if ((qtype == T_A || qtype == T_AAAA ||
 		     qtype == T_ANY) && type == T_CNAME) {
 			if (haveanswer) {
 				int level = LOG_CRIT;
@@ -1228,52 +817,6 @@
 			bp += n;
 			continue;
 		}
-		if (type == ns_t_dname) {
-			const char *t0, *t;
-
-			/*
-			 * just replace the query target; do not update the
-			 * alias list. (Or should we?)
-			 */
-			t0 = (qtype == T_PTR) ? tname : hname;
-
-			n = dn_expand(ansbuf, eor, cp, tbuf, sizeof(tbuf));
-			if (n < 0 || !maybe_dnok(pvt->res, tbuf)) {
-				had_error++;
-				continue;
-			}
-#ifdef RES_USE_DNAME
-			if ((pvt ->res->options & RES_USE_DNAME) == 0) {
-				cp += n;
-				continue;
-			}
-#endif
-			if ((t = dname_subst(t0, bp, tbuf)) == NULL) {
-				cp += n;
-				continue;
-			}
-#if 0				/* for debug */
-			if ((pvt->res->options & RES_DEBUG) != 0) {
-				printf("DNAME owner=%s, target=%s, next=%s\n",
-				       bp, tbuf, t);
-			}
-#endif
-			cp += n;
-
-			n = strlen(t) + 1; /* for the \0 */
-			if (n > (ep - bp)) {
-				had_error++;
-				continue;
-			}
-			strcpy(bp, t);
-			if (qtype == T_PTR)
-				tname = bp;
-			else
-				hname = bp;
-			bp += n;
-
-			continue;
-		}
 		if (qtype == T_PTR && type == T_CNAME) {
 			n = dn_expand(ansbuf, eor, cp, tbuf, sizeof tbuf);
 			if (n < 0 || !maybe_dnok(pvt->res, tbuf)) {
@@ -1281,9 +824,6 @@
 				continue;
 			}
 			cp += n;
-#ifdef RES_USE_DNAME
-			if ((pvt->res->options & RES_USE_DNAME) != 0)
-#endif
 			{
 				/*
 				 * We may be able to check this regardless
@@ -1306,8 +846,7 @@
 			continue;
 		}
 		if (qtype == T_ANY) {
-			if (!(type == T_A || type == T_AAAA ||
-			      type == ns_t_a6)) {
+			if (!(type == T_A || type == T_AAAA)) {
 				cp += n;
 				continue;
 			}
@@ -1346,66 +885,6 @@
 				bp += n;
 			}
 			break;
-		case ns_t_a6: {
-			struct in6_addr in6;
-			struct addrinfo ai;
-
-#ifdef RES_USE_A6
-			if ((pvt->res->options & RES_USE_A6) == 0) {
-				cp += n;
-				continue;
-			}
-#endif
-
-			if (ns_samename(hname, bp) != 1) {
-				cp += n;
-				continue;
-			}
-
-			/*
-			 * search for the top of the additional section.
-			 * once found, keep it for the case where we have
-			 * more than one A6 record.
-			 * XXX: however, we may not need this part.
-			 */
-			if (arp == NULL && arcount > 0) {
-				int nscount = ntohs(hp->nscount);
-
-				arp = ar_head(cp + n, nscount + ancount - 1,
-					      ansbuf, eom, pvt, name_ok);
-			}
-
-			/* recursively collect the whole A6 chain */
-			ai = *pai; /* XXX: we can't override constant pai */
-			ai.ai_family = AF_INET6;
-			memset(&in6, 0, sizeof(in6)); /* just for safety */
-			cur->ai_next = a6_expand(ansbuf, cp, n, arp, eom,
-						 &in6, 128,
-						 (const struct addrinfo *)&ai,
-						 pvt, name_ok, &error);
-			if (error != NETDB_SUCCESS) {
-#ifdef DEBUG
-				/* in this case, cur->ai_next must be NULL. */
-				if (cur->ai_next != NULL)
-					abort();
-#endif
-				had_error++;
-				continue;
-			}
-
-			/*
-			 * We don't bother even if cur->ai_next is NULL unless
-			 * the expansion failed by a fatal error. The list
-			 * can be NULL if the given A6 is incomplete, but we
-			 * may have another complete A6 chain in this answer.
-			 * See the last paragraph of RFC 2874 Section 3.1.4. 
- 			 */
-			if (cur->ai_next == NULL) {
-				cp += n;
-				continue; /* no error, no answer */
-			}
-			goto convertinfo;
-		} /* FALLTHROUGH */
 		case T_A:
 		case T_AAAA:
 			if (ns_samename(hname, bp) != 1) {
@@ -1430,7 +909,6 @@
 			if (cur->ai_next == NULL)
 				had_error++;
 
-		  convertinfo:	/* convert addrinfo into hostent form */
 			if (!haveanswer) {
 				int nn;
 
diff -u -r work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_debug.c work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_debug.c
--- work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_debug.c	Tue May 21 11:07:50 2002
+++ work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_debug.c	Thu Sep  5 08:40:00 2002
@@ -615,12 +615,6 @@
 #ifdef RES_USE_EDNS0	/* KAME extension */
 	case RES_USE_EDNS0:	return "edns0";
 #endif
-#ifdef RES_USE_A6
-	case RES_USE_A6:	return "a6";
-#endif
-#ifdef RES_USE_DNAME
-	case RES_USE_DNAME:	return "dname";
-#endif
 #ifdef RES_USE_DNSSEC
 	case RES_USE_DNSSEC:	return "dnssec";
 #endif
diff -u -r work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_findzonecut.c work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_findzonecut.c
--- work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_findzonecut.c	Mon May  6 13:12:55 2002
+++ work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_findzonecut.c	Thu Sep  5 08:47:38 2002
@@ -320,8 +320,7 @@
 					 p_section(sect, ns_o_query), i));
 				return (-1);
 			}
-			if (ns_rr_type(rr) == ns_t_cname ||
-			    ns_rr_type(rr) == ns_t_dname)
+			if (ns_rr_type(rr) == ns_t_cname)
 				break;
 			if (ns_rr_type(rr) != ns_t_soa ||
 			    ns_rr_class(rr) != class)
@@ -669,8 +668,7 @@
 			return (-1);
 		}
 		n += (ns_rr_class(rr) == class &&
-		      (ns_rr_type(rr) == ns_t_cname ||
-		       ns_rr_type(rr) == ns_t_dname));
+		      ns_rr_type(rr) == ns_t_cname);
 	}
 	return (n);
 }
diff -u -r work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_init.c work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_init.c
--- work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_init.c	Mon Jun  3 09:34:57 2002
+++ work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_init.c	Thu Sep  5 08:40:10 2002
@@ -196,7 +196,6 @@
 		statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr;
 		strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa");
 		strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int");
-		strcpy(statp->_u._ext.ext->bsuffix, "ip6.arpa");
 	}
 #ifdef RESOLVSORT
 	statp->nsort = 0;
@@ -507,12 +506,6 @@
 			statp->options |= RES_USE_EDNS0;
 		}
 #endif
-		else if (!strncmp(cp, "a6", sizeof("a6") - 1)) {
-			statp->options |= RES_USE_A6;
-		}
-		else if (!strncmp(cp, "dname", sizeof("dname") - 1)) {
-			statp->options |= RES_USE_DNAME;
-		}
 		else if (!strncmp(cp, "nibble:", sizeof("nibble:") - 1)) {
 			if (ext == NULL)
 				goto skip;
@@ -529,14 +522,6 @@
 			strncpy(ext->nsuffix2, cp, i);
 			ext->nsuffix2[i] = '\0';
 		}
-		else if (!strncmp(cp, "bitstring:", sizeof("bitstring:") - 1)) {
-			if (ext == NULL)
-				goto skip;
-			cp += sizeof("bitstring:") - 1;
-			i = MIN(strcspn(cp, " \t"), sizeof(ext->bsuffix) - 1);
-			strncpy(ext->bsuffix, cp, i);
-			ext->bsuffix[i] = '\0';
-		}
 		else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) {
 			cp += sizeof("v6revmode:") - 1;
 			/* "nibble" and "bitstring" used to be valid */
@@ -626,13 +611,6 @@
 	if (statp->_u._ext.ext)
 		return (statp->_u._ext.ext->nsuffix2);
 	return ("ip6.int");
-}
-
-const char *
-res_get_bitstringsuffix(res_state statp) {
-	if (statp->_u._ext.ext)
-		return (statp->_u._ext.ext->bsuffix);
-	return ("ip6.arpa");
 }
 
 void
diff -u -r work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_private.h work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_private.h
--- work.i386-/bind-9.3.0s20020722/lib/bind/resolv/res_private.h	Mon Jun  3 09:34:58 2002
+++ work.i386/bind-9.3.0s20020722/lib/bind/resolv/res_private.h	Thu Sep  5 08:36:01 2002
@@ -11,7 +11,6 @@
 		} addr, mask;
 	} sort_list[MAXRESOLVSORT];
 	char nsuffix[64];
-	char bsuffix[64];
 	char nsuffix2[64];
 };
 


More information about the bind-workers mailing list