mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Failure to pass a valid IPv6 address now returns DNS_R_BADAAAA.
This commit is contained in:
@@ -45,8 +45,9 @@ typedef unsigned int dns_result_t;
|
|||||||
#define DNS_R_NOTFOUND 22
|
#define DNS_R_NOTFOUND 22
|
||||||
#define DNS_R_SYNTAX 23
|
#define DNS_R_SYNTAX 23
|
||||||
#define DNS_R_BADCKSUM 24
|
#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
|
#define DNS_R_UNEXPECTED 0xFFFFFFFFL
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* 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 */
|
/* 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,
|
RETERR(gettoken(lexer, &token, isc_tokentype_string,
|
||||||
ISC_FALSE));
|
ISC_FALSE));
|
||||||
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
|
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
|
||||||
return (DNS_R_UNEXPECTED);
|
return (DNS_R_BADAAAA);
|
||||||
mask = 0xff >> (prefixlen % 8);
|
mask = 0xff >> (prefixlen % 8);
|
||||||
addr[octets] &= mask;
|
addr[octets] &= mask;
|
||||||
RETERR(mem_tobuffer(target, &addr[octets], 16 - octets));
|
RETERR(mem_tobuffer(target, &addr[octets], 16 - octets));
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* 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 */
|
/* 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,
|
RETERR(gettoken(lexer, &token, isc_tokentype_string,
|
||||||
ISC_FALSE));
|
ISC_FALSE));
|
||||||
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
|
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
|
||||||
return (DNS_R_UNEXPECTED);
|
return (DNS_R_BADAAAA);
|
||||||
mask = 0xff >> (prefixlen % 8);
|
mask = 0xff >> (prefixlen % 8);
|
||||||
addr[octets] &= mask;
|
addr[octets] &= mask;
|
||||||
RETERR(mem_tobuffer(target, &addr[octets], 16 - octets));
|
RETERR(mem_tobuffer(target, &addr[octets], 16 - octets));
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* 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 */
|
/* 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));
|
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||||
|
|
||||||
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
|
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);
|
isc_buffer_available(target, ®ion);
|
||||||
if (region.length < 16)
|
if (region.length < 16)
|
||||||
return (DNS_R_NOSPACE);
|
return (DNS_R_NOSPACE);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* 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 */
|
/* 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));
|
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||||
|
|
||||||
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
|
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);
|
isc_buffer_available(target, ®ion);
|
||||||
if (region.length < 16)
|
if (region.length < 16)
|
||||||
return (DNS_R_NOSPACE);
|
return (DNS_R_NOSPACE);
|
||||||
|
@@ -45,6 +45,7 @@ static char *text_table[DNS_R_LASTENTRY + 1] = {
|
|||||||
"not found", /* 22 */
|
"not found", /* 22 */
|
||||||
"syntax error", /* 23 */
|
"syntax error", /* 23 */
|
||||||
"bad checksum", /* 24 */
|
"bad checksum", /* 24 */
|
||||||
|
"bad IPv6 address", /* 25 */
|
||||||
};
|
};
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
Reference in New Issue
Block a user