2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Failure to pass a valid IPv6 address now returns DNS_R_BADAAAA.

This commit is contained in:
Mark Andrews
1999-02-09 07:52:32 +00:00
parent 767d29c43d
commit b8ea456f92
6 changed files with 11 additions and 9 deletions

View File

@@ -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

View File

@@ -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));

View File

@@ -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));

View File

@@ -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, &region);
if (region.length < 16)
return (DNS_R_NOSPACE);

View File

@@ -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, &region);
if (region.length < 16)
return (DNS_R_NOSPACE);

View File

@@ -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 *