nibble reverse lookup under ip6.arpa

Jun-ichiro itojun Hagino itojun at iijlab.net
Thu May 30 13:33:53 UTC 2002


	the patch will make reverse lookup under ip6.arpa zone be nibble-
	formatted, as suggested in draft-ietf-dnsext-ipv6-addresses-01.txt.

itojun

Index: lib/dns/byaddr.c
===================================================================
RCS file: /cvsroot/apps/bind9/lib/dns/byaddr.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 byaddr.c
--- lib/dns/byaddr.c	2001/09/04 06:26:02	1.1.1.5
+++ lib/dns/byaddr.c	2002/05/30 13:32:25
@@ -91,27 +91,17 @@
 			      (bytes[1] & 0xff),
 			      (bytes[0] & 0xff));
 	} else if (address->family == AF_INET6) {
+		cp = textname;
+		for (i = 15; i >= 0; i--) {
+			*cp++ = hex_digits[bytes[i] & 0x0f];
+			*cp++ = '.';
+			*cp++ = hex_digits[(bytes[i] >> 4) & 0x0f];
+			*cp++ = '.';
+		}
 		if (nibble) {
-			cp = textname;
-			for (i = 15; i >= 0; i--) {
-				*cp++ = hex_digits[bytes[i] & 0x0f];
-				*cp++ = '.';
-				*cp++ = hex_digits[(bytes[i] >> 4) & 0x0f];
-				*cp++ = '.';
-			}
 			strcpy(cp, "ip6.int.");
 		} else {
-			cp = textname;
-			*cp++ = '\\';
-			*cp++ = '[';
-			*cp++ = 'x';
-			for (i = 0; i < 16; i += 2) {
-				*cp++ = hex_digits[(bytes[i] >> 4) & 0x0f];
-				*cp++ = hex_digits[bytes[i] & 0x0f];
-				*cp++ = hex_digits[(bytes[i+1] >> 4) & 0x0f];
-				*cp++ = hex_digits[bytes[i+1] & 0x0f];
-			}
-			strcpy(cp, "].ip6.arpa.");
+			strcpy(cp, "ip6.arpa.");
 		}
 	} else
 		return (ISC_R_NOTIMPLEMENTED);


More information about the bind-workers mailing list