diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index 868a24b81f..3e6f68d98f 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -45,8 +45,9 @@ typedef unsigned int dns_result_t; #define DNS_R_NOTFOUND 22 #define DNS_R_SYNTAX 23 #define DNS_R_BADCKSUM 24 +#define DNS_R_BADAAAA 25 -#define DNS_R_LASTENTRY 24 /* Last entry on list. */ +#define DNS_R_LASTENTRY 25 /* Last entry on list. */ #define DNS_R_UNEXPECTED 0xFFFFFFFFL diff --git a/lib/dns/rdata/in_1/a6_38.c b/lib/dns/rdata/in_1/a6_38.c index abb5ff6d0c..a15eb6f576 100644 --- a/lib/dns/rdata/in_1/a6_38.c +++ b/lib/dns/rdata/in_1/a6_38.c @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: a6_38.c,v 1.2 1999/02/06 01:45:11 halley Exp $ */ + /* $Id: a6_38.c,v 1.3 1999/02/09 07:52:32 marka Exp $ */ /* draft-ietf-ipngwg-dns-lookups-03.txt */ @@ -68,7 +68,7 @@ fromtext_in_a6(dns_rdataclass_t class, dns_rdatatype_t type, RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) - return (DNS_R_UNEXPECTED); + return (DNS_R_BADAAAA); mask = 0xff >> (prefixlen % 8); addr[octets] &= mask; RETERR(mem_tobuffer(target, &addr[octets], 16 - octets)); diff --git a/lib/dns/rdata/in_1/a6_38.h b/lib/dns/rdata/in_1/a6_38.h index 8ddada4bd3..6dc0a2aa5a 100644 --- a/lib/dns/rdata/in_1/a6_38.h +++ b/lib/dns/rdata/in_1/a6_38.h @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: a6_38.h,v 1.2 1999/02/06 01:45:11 halley Exp $ */ + /* $Id: a6_38.h,v 1.3 1999/02/09 07:52:32 marka Exp $ */ /* draft-ietf-ipngwg-dns-lookups-03.txt */ @@ -68,7 +68,7 @@ fromtext_in_a6(dns_rdataclass_t class, dns_rdatatype_t type, RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) - return (DNS_R_UNEXPECTED); + return (DNS_R_BADAAAA); mask = 0xff >> (prefixlen % 8); addr[octets] &= mask; RETERR(mem_tobuffer(target, &addr[octets], 16 - octets)); diff --git a/lib/dns/rdata/in_1/aaaa_28.c b/lib/dns/rdata/in_1/aaaa_28.c index 38435f76ec..c57bde1c95 100644 --- a/lib/dns/rdata/in_1/aaaa_28.c +++ b/lib/dns/rdata/in_1/aaaa_28.c @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: aaaa_28.c,v 1.4 1999/02/06 01:45:11 halley Exp $ */ + /* $Id: aaaa_28.c,v 1.5 1999/02/09 07:52:31 marka Exp $ */ /* RFC 1886 */ @@ -49,7 +49,7 @@ fromtext_in_aaaa(dns_rdataclass_t class, dns_rdatatype_t type, RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) - return (DNS_R_UNEXPECTED); + return (DNS_R_BADAAAA); isc_buffer_available(target, ®ion); if (region.length < 16) return (DNS_R_NOSPACE); diff --git a/lib/dns/rdata/in_1/aaaa_28.h b/lib/dns/rdata/in_1/aaaa_28.h index 7904de0a03..98e4d8ad05 100644 --- a/lib/dns/rdata/in_1/aaaa_28.h +++ b/lib/dns/rdata/in_1/aaaa_28.h @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: aaaa_28.h,v 1.4 1999/02/06 01:45:11 halley Exp $ */ + /* $Id: aaaa_28.h,v 1.5 1999/02/09 07:52:31 marka Exp $ */ /* RFC 1886 */ @@ -49,7 +49,7 @@ fromtext_in_aaaa(dns_rdataclass_t class, dns_rdatatype_t type, RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) - return (DNS_R_UNEXPECTED); + return (DNS_R_BADAAAA); isc_buffer_available(target, ®ion); if (region.length < 16) return (DNS_R_NOSPACE); diff --git a/lib/dns/result.c b/lib/dns/result.c index 66676093fd..527cf5c58f 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -45,6 +45,7 @@ static char *text_table[DNS_R_LASTENTRY + 1] = { "not found", /* 22 */ "syntax error", /* 23 */ "bad checksum", /* 24 */ + "bad IPv6 address", /* 25 */ }; char *