From 9ac7076ebad044afb15e9e2687e3696868778538 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 6 Mar 2001 22:11:18 +0000 Subject: [PATCH] 769. [func] Improved error reporting when parsing rdata. [RT #740] Two new error codes. Also push back the last token, if it makes sense to do so, so that it gets printed in the error message using RETTOK macro, rather than straight return or RETERR. --- CHANGES | 2 + lib/dns/include/dns/result.h | 7 +-- lib/dns/rdata.c | 19 +++++--- lib/dns/rdata/any_255/tsig_250.c | 20 ++++----- lib/dns/rdata/generic/afsdb_18.c | 7 +-- lib/dns/rdata/generic/cert_37.c | 8 ++-- lib/dns/rdata/generic/cname_5.c | 5 ++- lib/dns/rdata/generic/dname_39.c | 5 ++- lib/dns/rdata/generic/gpos_27.c | 4 +- lib/dns/rdata/generic/hinfo_13.c | 4 +- lib/dns/rdata/generic/isdn_20.c | 7 +-- lib/dns/rdata/generic/key_25.c | 8 ++-- lib/dns/rdata/generic/loc_29.c | 76 ++++++++++++++++---------------- lib/dns/rdata/generic/mb_7.c | 5 ++- lib/dns/rdata/generic/md_3.c | 5 ++- lib/dns/rdata/generic/mf_4.c | 5 ++- lib/dns/rdata/generic/mg_8.c | 5 ++- lib/dns/rdata/generic/minfo_14.c | 4 +- lib/dns/rdata/generic/mr_9.c | 5 ++- lib/dns/rdata/generic/mx_15.c | 7 +-- lib/dns/rdata/generic/ns_2.c | 5 ++- lib/dns/rdata/generic/nxt_30.c | 6 +-- lib/dns/rdata/generic/opt_41.c | 4 +- lib/dns/rdata/generic/ptr_12.c | 5 ++- lib/dns/rdata/generic/rp_17.c | 4 +- lib/dns/rdata/generic/rt_21.c | 7 +-- lib/dns/rdata/generic/sig_24.c | 16 +++---- lib/dns/rdata/generic/soa_6.c | 6 +-- lib/dns/rdata/generic/tkey_249.c | 14 +++--- lib/dns/rdata/generic/txt_16.c | 4 +- lib/dns/rdata/generic/x25_19.c | 9 ++-- lib/dns/rdata/hs_4/a_1.c | 4 +- lib/dns/rdata/in_1/a6_38.c | 9 ++-- lib/dns/rdata/in_1/a_1.c | 4 +- lib/dns/rdata/in_1/aaaa_28.c | 4 +- lib/dns/rdata/in_1/kx_36.c | 7 +-- lib/dns/rdata/in_1/naptr_35.c | 15 ++++--- lib/dns/rdata/in_1/nsap-ptr_23.c | 5 ++- lib/dns/rdata/in_1/nsap_22.c | 13 +++--- lib/dns/rdata/in_1/px_26.c | 9 ++-- lib/dns/rdata/in_1/srv_33.c | 11 ++--- lib/dns/rdata/in_1/wks_11.c | 12 ++--- lib/dns/result.c | 5 ++- 43 files changed, 209 insertions(+), 177 deletions(-) diff --git a/CHANGES b/CHANGES index af1f3a0074..9cb528cf17 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ + 769. [func] Improved error reporting when parsing rdata. [RT #740] + 768. [bug] The server did not emit an SOA when a CNAME or DNAME chain ended in NXDOMAIN in an authoritative zone. diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index 7ffe420ed1..c591773210 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.78 2001/02/26 01:45:56 marka Exp $ */ +/* $Id: result.h,v 1.79 2001/03/06 22:10:34 marka Exp $ */ #ifndef DNS_RESULT_H #define DNS_RESULT_H 1 @@ -98,7 +98,7 @@ #define DNS_R_NOVALIDSIG (ISC_RESULTCLASS_DNS + 59) #define DNS_R_NOVALIDNXT (ISC_RESULTCLASS_DNS + 60) #define DNS_R_NOTINSECURE (ISC_RESULTCLASS_DNS + 61) -/* #define DNS_R_unused (ISC_RESULTCLASS_DNS + 62) */ +#define DNS_R_UNKNOWNSERVICE (ISC_RESULTCLASS_DNS + 62) #define DNS_R_RECOVERABLE (ISC_RESULTCLASS_DNS + 63) #define DNS_R_UNKNOWNOPT (ISC_RESULTCLASS_DNS + 64) #define DNS_R_UNEXPECTEDID (ISC_RESULTCLASS_DNS + 65) @@ -111,8 +111,9 @@ #define DNS_R_SINGLETON (ISC_RESULTCLASS_DNS + 72) #define DNS_R_HINTNXRRSET (ISC_RESULTCLASS_DNS + 73) #define DNS_R_NOMASTERFILE (ISC_RESULTCLASS_DNS + 74) +#define DNS_R_UNKNOWNPROTO (ISC_RESULTCLASS_DNS + 75) -#define DNS_R_NRESULTS 75 /* Number of results */ +#define DNS_R_NRESULTS 76 /* Number of results */ /* * DNS wire format rcodes. diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 8aa595f231..277f045ad7 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdata.c,v 1.142 2001/01/25 20:14:36 bwelling Exp $ */ +/* $Id: rdata.c,v 1.143 2001/03/06 22:10:33 marka Exp $ */ #include #include @@ -43,10 +43,19 @@ #include #include -#define RETERR(x) do { \ - isc_result_t _r = (x); \ - if (_r != ISC_R_SUCCESS) \ - return (_r); \ +#define RETERR(x) \ + do { \ + isc_result_t _r = (x); \ + if (_r != ISC_R_SUCCESS) \ + return (_r); \ + } while (0) +#define RETTOK(x) \ + do { \ + isc_result_t _r = (x); \ + if (_r != ISC_R_SUCCESS) { \ + isc_lex_ungettoken(lexer, &token); \ + return (_r); \ + } \ } while (0) #define ARGS_FROMTEXT int rdclass, dns_rdatatype_t type, \ diff --git a/lib/dns/rdata/any_255/tsig_250.c b/lib/dns/rdata/any_255/tsig_250.c index 9943e18b78..1607df3c25 100644 --- a/lib/dns/rdata/any_255/tsig_250.c +++ b/lib/dns/rdata/any_255/tsig_250.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tsig_250.c,v 1.48 2001/02/12 03:04:37 bwelling Exp $ */ +/* $Id: tsig_250.c,v 1.49 2001/03/06 22:10:35 marka Exp $ */ /* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */ @@ -48,7 +48,7 @@ fromtext_any_tsig(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - RETERR(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); /* * Time Signed: 48 bits. @@ -57,9 +57,9 @@ fromtext_any_tsig(ARGS_FROMTEXT) { ISC_FALSE)); sigtime = isc_string_touint64(token.value.as_pointer, &e, 10); if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if ((sigtime >> 48) != 0) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer((isc_uint16_t)(sigtime >> 32), target)); RETERR(uint32_tobuffer((isc_uint32_t)(sigtime & 0xffffffffU), target)); @@ -69,7 +69,7 @@ fromtext_any_tsig(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -78,7 +78,7 @@ fromtext_any_tsig(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -92,7 +92,7 @@ fromtext_any_tsig(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -105,9 +105,9 @@ fromtext_any_tsig(ARGS_FROMTEXT) { { i = strtol(token.value.as_pointer, &e, 10); if (*e != 0) - return (DNS_R_UNKNOWN); + RETTOK(DNS_R_UNKNOWN); if (i < 0 || i > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); rcode = (dns_rcode_t)i; } RETERR(uint16_tobuffer(rcode, target)); @@ -118,7 +118,7 @@ fromtext_any_tsig(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* diff --git a/lib/dns/rdata/generic/afsdb_18.c b/lib/dns/rdata/generic/afsdb_18.c index 86adb700c4..3d182269fc 100644 --- a/lib/dns/rdata/generic/afsdb_18.c +++ b/lib/dns/rdata/generic/afsdb_18.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: afsdb_18.c,v 1.36 2001/02/12 03:04:38 bwelling Exp $ */ +/* $Id: afsdb_18.c,v 1.37 2001/03/06 22:10:37 marka Exp $ */ /* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */ @@ -42,7 +42,7 @@ fromtext_afsdb(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -53,7 +53,8 @@ fromtext_afsdb(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/cert_37.c b/lib/dns/rdata/generic/cert_37.c index 80cc01e939..20919a0065 100644 --- a/lib/dns/rdata/generic/cert_37.c +++ b/lib/dns/rdata/generic/cert_37.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cert_37.c,v 1.36 2001/01/09 21:53:52 bwelling Exp $ */ +/* $Id: cert_37.c,v 1.37 2001/03/06 22:10:38 marka Exp $ */ /* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */ @@ -43,7 +43,7 @@ fromtext_cert(ARGS_FROMTEXT) { */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_cert_fromtext(&cert, &token.value.as_textregion)); + RETTOK(dns_cert_fromtext(&cert, &token.value.as_textregion)); RETERR(uint16_tobuffer(cert, target)); /* @@ -52,7 +52,7 @@ fromtext_cert(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -60,7 +60,7 @@ fromtext_cert(ARGS_FROMTEXT) { */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_secalg_fromtext(&secalg, &token.value.as_textregion)); + RETTOK(dns_secalg_fromtext(&secalg, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &secalg, 1)); return (isc_base64_tobuffer(lexer, target, -1)); diff --git a/lib/dns/rdata/generic/cname_5.c b/lib/dns/rdata/generic/cname_5.c index 389d383bf4..3f6b3cf48e 100644 --- a/lib/dns/rdata/generic/cname_5.c +++ b/lib/dns/rdata/generic/cname_5.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cname_5.c,v 1.40 2001/02/12 03:04:39 bwelling Exp $ */ +/* $Id: cname_5.c,v 1.41 2001/03/06 22:10:39 marka Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -41,7 +41,8 @@ fromtext_cname(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/dname_39.c b/lib/dns/rdata/generic/dname_39.c index 7f0a24a922..f44f6e41d3 100644 --- a/lib/dns/rdata/generic/dname_39.c +++ b/lib/dns/rdata/generic/dname_39.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dname_39.c,v 1.30 2001/02/12 03:04:40 bwelling Exp $ */ +/* $Id: dname_39.c,v 1.31 2001/03/06 22:10:40 marka Exp $ */ /* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */ @@ -42,7 +42,8 @@ fromtext_dname(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/gpos_27.c b/lib/dns/rdata/generic/gpos_27.c index c954297bd3..2fd16b563f 100644 --- a/lib/dns/rdata/generic/gpos_27.c +++ b/lib/dns/rdata/generic/gpos_27.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: gpos_27.c,v 1.28 2001/01/09 21:53:59 bwelling Exp $ */ +/* $Id: gpos_27.c,v 1.29 2001/03/06 22:10:41 marka Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -41,7 +41,7 @@ fromtext_gpos(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); - RETERR(txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); } return (ISC_R_SUCCESS); } diff --git a/lib/dns/rdata/generic/hinfo_13.c b/lib/dns/rdata/generic/hinfo_13.c index e39cb80212..5782685cd9 100644 --- a/lib/dns/rdata/generic/hinfo_13.c +++ b/lib/dns/rdata/generic/hinfo_13.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hinfo_13.c,v 1.33 2001/01/09 21:54:01 bwelling Exp $ */ +/* $Id: hinfo_13.c,v 1.34 2001/03/06 22:10:42 marka Exp $ */ /* * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. @@ -41,7 +41,7 @@ fromtext_hinfo(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); - RETERR(txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); } return (ISC_R_SUCCESS); } diff --git a/lib/dns/rdata/generic/isdn_20.c b/lib/dns/rdata/generic/isdn_20.c index 463e3afe04..9f62d6ff10 100644 --- a/lib/dns/rdata/generic/isdn_20.c +++ b/lib/dns/rdata/generic/isdn_20.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: isdn_20.c,v 1.26 2001/01/09 21:54:04 bwelling Exp $ */ +/* $Id: isdn_20.c,v 1.27 2001/03/06 22:10:43 marka Exp $ */ /* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */ @@ -39,7 +39,7 @@ fromtext_isdn(ARGS_FROMTEXT) { /* ISDN-address */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); - RETERR(txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); /* sa: optional */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, @@ -49,7 +49,8 @@ fromtext_isdn(ARGS_FROMTEXT) { isc_lex_ungettoken(lexer, &token); return (ISC_R_SUCCESS); } - return (txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/key_25.c b/lib/dns/rdata/generic/key_25.c index 6b4cde2b69..08068ee649 100644 --- a/lib/dns/rdata/generic/key_25.c +++ b/lib/dns/rdata/generic/key_25.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: key_25.c,v 1.36 2001/01/09 21:54:06 bwelling Exp $ */ +/* $Id: key_25.c,v 1.37 2001/03/06 22:10:44 marka Exp $ */ /* * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. @@ -46,19 +46,19 @@ fromtext_key(ARGS_FROMTEXT) { /* flags */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_keyflags_fromtext(&flags, &token.value.as_textregion)); + RETTOK(dns_keyflags_fromtext(&flags, &token.value.as_textregion)); RETERR(uint16_tobuffer(flags, target)); /* protocol */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_secproto_fromtext(&proto, &token.value.as_textregion)); + RETTOK(dns_secproto_fromtext(&proto, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &proto, 1)); /* algorithm */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_secalg_fromtext(&alg, &token.value.as_textregion)); + RETTOK(dns_secalg_fromtext(&alg, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &alg, 1)); /* No Key? */ diff --git a/lib/dns/rdata/generic/loc_29.c b/lib/dns/rdata/generic/loc_29.c index 6444680aac..fcbf50b814 100644 --- a/lib/dns/rdata/generic/loc_29.c +++ b/lib/dns/rdata/generic/loc_29.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: loc_29.c,v 1.27 2001/01/09 21:54:08 bwelling Exp $ */ +/* $Id: loc_29.c,v 1.28 2001/03/06 22:10:45 marka Exp $ */ /* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */ @@ -72,7 +72,7 @@ fromtext_loc(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 90) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); d1 = (int)token.value.as_ulong; /* * Minutes. @@ -85,11 +85,11 @@ fromtext_loc(ARGS_FROMTEXT) { goto getlong; m1 = strtol(token.value.as_pointer, &e, 10); if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (m1 < 0 || m1 > 59) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (d1 == 90 && m1 != 0) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); /* * Seconds. @@ -102,27 +102,27 @@ fromtext_loc(ARGS_FROMTEXT) { goto getlong; s1 = strtol(token.value.as_pointer, &e, 10); if (*e != 0 && *e != '.') - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (s1 < 0 || s1 > 59) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (*e == '.') { e++; for (i = 0; i < 3 ; i++) { if (*e == 0) break; if ((tmp = decvalue(*e++)) < 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); s1 *= 10; s1 += tmp; } for ( ; i < 3 ; i++) s1 *= 10; if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); } else s1 *= 1000; if (d1 == 90 && s1 != 0) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); /* * Direction. @@ -132,7 +132,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (strcasecmp(token.value.as_pointer, "N") == 0) north = ISC_TRUE; if (!north && strcasecmp(token.value.as_pointer, "S") != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); getlong: /* @@ -141,7 +141,7 @@ fromtext_loc(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 180) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); d2 = (int)token.value.as_ulong; /* @@ -155,11 +155,11 @@ fromtext_loc(ARGS_FROMTEXT) { goto getalt; m2 = strtol(token.value.as_pointer, &e, 10); if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (m2 < 0 || m2 > 59) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (d2 == 180 && m2 != 0) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); /* * Seconds. @@ -172,27 +172,27 @@ fromtext_loc(ARGS_FROMTEXT) { goto getalt; s2 = strtol(token.value.as_pointer, &e, 10); if (*e != 0 && *e != '.') - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (s2 < 0 || s2 > 59) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (*e == '.') { e++; for (i = 0; i < 3 ; i++) { if (*e == 0) break; if ((tmp = decvalue(*e++)) < 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); s2 *= 10; s2 += tmp; } for ( ; i < 3 ; i++) s2 *= 10; if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); } else s2 *= 1000; if (d2 == 180 && s2 != 0) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); /* * Direction. @@ -202,7 +202,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (strcasecmp(token.value.as_pointer, "E") == 0) east = ISC_TRUE; if (!east && strcasecmp(token.value.as_pointer, "W") != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); getalt: /* @@ -212,9 +212,9 @@ fromtext_loc(ARGS_FROMTEXT) { ISC_FALSE)); m = strtol(token.value.as_pointer, &e, 10); if (*e != 0 && *e != '.' && *e != 'm') - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (m < -100000 || m > 42849672) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); cm = 0; if (*e == '.') { e++; @@ -235,11 +235,11 @@ fromtext_loc(ARGS_FROMTEXT) { if (*e == 'm') e++; if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (m == -100000 && cm != 0) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (m == 42849672 && cm > 95) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); /* * Adjust base. */ @@ -259,9 +259,9 @@ fromtext_loc(ARGS_FROMTEXT) { } m = strtol(token.value.as_pointer, &e, 10); if (*e != 0 && *e != '.' && *e != 'm') - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (m < 0 || m > 90000000) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); cm = 0; if (*e == '.') { e++; @@ -269,7 +269,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (*e == 0 || *e == 'm') break; if ((tmp = decvalue(*e++)) < 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); cm *= 10; cm += tmp; } @@ -279,7 +279,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (*e == 'm') e++; if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); /* * We don't just multiply out as we will overflow. */ @@ -312,9 +312,9 @@ fromtext_loc(ARGS_FROMTEXT) { } m = strtol(token.value.as_pointer, &e, 10); if (*e != 0 && *e != '.' && *e != 'm') - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (m < 0 || m > 90000000) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); cm = 0; if (*e == '.') { e++; @@ -322,7 +322,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (*e == 0 || *e == 'm') break; if ((tmp = decvalue(*e++)) < 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); cm *= 10; cm += tmp; } @@ -332,7 +332,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (*e == 'm') e++; if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); /* * We don't just multiply out as we will overflow. */ @@ -363,9 +363,9 @@ fromtext_loc(ARGS_FROMTEXT) { } m = strtol(token.value.as_pointer, &e, 10); if (*e != 0 && *e != '.' && *e != 'm') - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); if (m < 0 || m > 90000000) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); cm = 0; if (*e == '.') { e++; @@ -373,7 +373,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (*e == 0 || *e == 'm') break; if ((tmp = decvalue(*e++)) < 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); cm *= 10; cm += tmp; } @@ -383,7 +383,7 @@ fromtext_loc(ARGS_FROMTEXT) { if (*e == 'm') e++; if (*e != 0) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); /* * We don't just multiply out as we will overflow. */ diff --git a/lib/dns/rdata/generic/mb_7.c b/lib/dns/rdata/generic/mb_7.c index adcf92830b..4896ebbc5d 100644 --- a/lib/dns/rdata/generic/mb_7.c +++ b/lib/dns/rdata/generic/mb_7.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mb_7.c,v 1.38 2001/02/12 03:04:41 bwelling Exp $ */ +/* $Id: mb_7.c,v 1.39 2001/03/06 22:10:47 marka Exp $ */ /* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */ @@ -40,7 +40,8 @@ fromtext_mb(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/md_3.c b/lib/dns/rdata/generic/md_3.c index a7ff82f9e3..6d7c0ac829 100644 --- a/lib/dns/rdata/generic/md_3.c +++ b/lib/dns/rdata/generic/md_3.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: md_3.c,v 1.40 2001/02/12 03:04:43 bwelling Exp $ */ +/* $Id: md_3.c,v 1.41 2001/03/06 22:10:48 marka Exp $ */ /* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */ @@ -40,7 +40,8 @@ fromtext_md(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/mf_4.c b/lib/dns/rdata/generic/mf_4.c index 03382a128f..274eeca717 100644 --- a/lib/dns/rdata/generic/mf_4.c +++ b/lib/dns/rdata/generic/mf_4.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mf_4.c,v 1.38 2001/02/12 03:04:44 bwelling Exp $ */ +/* $Id: mf_4.c,v 1.39 2001/03/06 22:10:49 marka Exp $ */ /* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */ @@ -40,7 +40,8 @@ fromtext_mf(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/mg_8.c b/lib/dns/rdata/generic/mg_8.c index da1e8d48ca..b54151734d 100644 --- a/lib/dns/rdata/generic/mg_8.c +++ b/lib/dns/rdata/generic/mg_8.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mg_8.c,v 1.36 2001/02/12 03:04:45 bwelling Exp $ */ +/* $Id: mg_8.c,v 1.37 2001/03/06 22:10:50 marka Exp $ */ /* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */ @@ -40,7 +40,8 @@ fromtext_mg(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/minfo_14.c b/lib/dns/rdata/generic/minfo_14.c index faee2b453b..94769d4b97 100644 --- a/lib/dns/rdata/generic/minfo_14.c +++ b/lib/dns/rdata/generic/minfo_14.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: minfo_14.c,v 1.37 2001/02/12 03:04:46 bwelling Exp $ */ +/* $Id: minfo_14.c,v 1.38 2001/03/06 22:10:51 marka Exp $ */ /* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */ @@ -42,7 +42,7 @@ fromtext_minfo(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - RETERR(dns_name_fromtext(&name, &buffer, origin, + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); } return (ISC_R_SUCCESS); diff --git a/lib/dns/rdata/generic/mr_9.c b/lib/dns/rdata/generic/mr_9.c index a8786b2247..b4ab442c14 100644 --- a/lib/dns/rdata/generic/mr_9.c +++ b/lib/dns/rdata/generic/mr_9.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mr_9.c,v 1.35 2001/02/12 03:04:47 bwelling Exp $ */ +/* $Id: mr_9.c,v 1.36 2001/03/06 22:10:52 marka Exp $ */ /* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */ @@ -40,7 +40,8 @@ fromtext_mr(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/mx_15.c b/lib/dns/rdata/generic/mx_15.c index a4dd0e740e..42db3f190d 100644 --- a/lib/dns/rdata/generic/mx_15.c +++ b/lib/dns/rdata/generic/mx_15.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mx_15.c,v 1.45 2001/02/12 03:04:48 bwelling Exp $ */ +/* $Id: mx_15.c,v 1.46 2001/03/06 22:10:53 marka Exp $ */ /* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */ @@ -37,7 +37,7 @@ fromtext_mx(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, @@ -45,7 +45,8 @@ fromtext_mx(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/ns_2.c b/lib/dns/rdata/generic/ns_2.c index 5af3b4d2c4..b1da019c9a 100644 --- a/lib/dns/rdata/generic/ns_2.c +++ b/lib/dns/rdata/generic/ns_2.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ns_2.c,v 1.39 2001/02/12 03:04:49 bwelling Exp $ */ +/* $Id: ns_2.c,v 1.40 2001/03/06 22:10:55 marka Exp $ */ /* Reviewed: Wed Mar 15 18:15:00 PST 2000 by bwelling */ @@ -40,7 +40,8 @@ fromtext_ns(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/nxt_30.c b/lib/dns/rdata/generic/nxt_30.c index 41d1af8598..ffa9fe0c7f 100644 --- a/lib/dns/rdata/generic/nxt_30.c +++ b/lib/dns/rdata/generic/nxt_30.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nxt_30.c,v 1.46 2001/02/12 03:04:51 bwelling Exp $ */ +/* $Id: nxt_30.c,v 1.47 2001/03/06 22:10:56 marka Exp $ */ /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ @@ -54,7 +54,7 @@ fromtext_nxt(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - RETERR(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); memset(bm, 0, sizeof bm); do { @@ -67,7 +67,7 @@ fromtext_nxt(ARGS_FROMTEXT) { covered = (dns_rdatatype_t)n; } else if (dns_rdatatype_fromtext(&covered, &token.value.as_textregion) == DNS_R_UNKNOWN) - return (DNS_R_UNKNOWN); + RETTOK(DNS_R_UNKNOWN); /* * NXT is only specified for types 1..127. */ diff --git a/lib/dns/rdata/generic/opt_41.c b/lib/dns/rdata/generic/opt_41.c index 78a1f8ce15..446d8abd78 100644 --- a/lib/dns/rdata/generic/opt_41.c +++ b/lib/dns/rdata/generic/opt_41.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: opt_41.c,v 1.21 2001/01/16 06:14:00 marka Exp $ */ +/* $Id: opt_41.c,v 1.22 2001/03/06 22:10:57 marka Exp $ */ /* Reviewed: Thu Mar 16 14:06:44 PST 2000 by gson */ @@ -29,7 +29,7 @@ DNS_RDATATYPEATTR_NOTQUESTION) static inline isc_result_t - fromtext_opt(ARGS_FROMTEXT) { +fromtext_opt(ARGS_FROMTEXT) { /* * OPT records do not have a text format. */ diff --git a/lib/dns/rdata/generic/ptr_12.c b/lib/dns/rdata/generic/ptr_12.c index 2f5e3eb159..ee8357bf1f 100644 --- a/lib/dns/rdata/generic/ptr_12.c +++ b/lib/dns/rdata/generic/ptr_12.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ptr_12.c,v 1.36 2001/02/12 03:04:52 bwelling Exp $ */ +/* $Id: ptr_12.c,v 1.37 2001/03/06 22:10:58 marka Exp $ */ /* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */ @@ -40,7 +40,8 @@ fromtext_ptr(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/rp_17.c b/lib/dns/rdata/generic/rp_17.c index a82b72dcc7..ce18d08f09 100644 --- a/lib/dns/rdata/generic/rp_17.c +++ b/lib/dns/rdata/generic/rp_17.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rp_17.c,v 1.32 2001/02/12 03:04:53 bwelling Exp $ */ +/* $Id: rp_17.c,v 1.33 2001/03/06 22:10:59 marka Exp $ */ /* RFC 1183 */ @@ -43,7 +43,7 @@ fromtext_rp(ARGS_FROMTEXT) { ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); - RETERR(dns_name_fromtext(&name, &buffer, origin, + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); } return (ISC_R_SUCCESS); diff --git a/lib/dns/rdata/generic/rt_21.c b/lib/dns/rdata/generic/rt_21.c index f5851979cb..a42a28f046 100644 --- a/lib/dns/rdata/generic/rt_21.c +++ b/lib/dns/rdata/generic/rt_21.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rt_21.c,v 1.34 2001/02/12 03:04:54 bwelling Exp $ */ +/* $Id: rt_21.c,v 1.35 2001/03/06 22:11:00 marka Exp $ */ /* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */ @@ -39,7 +39,7 @@ fromtext_rt(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, @@ -48,7 +48,8 @@ fromtext_rt(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/generic/sig_24.c b/lib/dns/rdata/generic/sig_24.c index fbf4b79c21..159bc13c4f 100644 --- a/lib/dns/rdata/generic/sig_24.c +++ b/lib/dns/rdata/generic/sig_24.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sig_24.c,v 1.50 2001/02/12 03:04:55 bwelling Exp $ */ +/* $Id: sig_24.c,v 1.51 2001/03/06 22:11:01 marka Exp $ */ /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ @@ -51,9 +51,9 @@ fromtext_sig(ARGS_FROMTEXT) { if (result != ISC_R_SUCCESS && result != ISC_R_NOTIMPLEMENTED) { i = strtol(token.value.as_pointer, &e, 10); if (i < 0 || i > 65535) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (*e != 0) - return (result); + RETTOK(result); covered = (dns_rdatatype_t)i; } RETERR(uint16_tobuffer(covered, target)); @@ -63,7 +63,7 @@ fromtext_sig(ARGS_FROMTEXT) { */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_secalg_fromtext(&c, &token.value.as_textregion)); + RETTOK(dns_secalg_fromtext(&c, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &c, 1)); /* @@ -72,7 +72,7 @@ fromtext_sig(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); c = (unsigned char)token.value.as_ulong; RETERR(mem_tobuffer(target, &c, 1)); @@ -88,7 +88,7 @@ fromtext_sig(ARGS_FROMTEXT) { */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_time32_fromtext(token.value.as_pointer, &time_expire)); + RETTOK(dns_time32_fromtext(token.value.as_pointer, &time_expire)); RETERR(uint32_tobuffer(time_expire, target)); /* @@ -96,7 +96,7 @@ fromtext_sig(ARGS_FROMTEXT) { */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_time32_fromtext(token.value.as_pointer, &time_signed)); + RETTOK(dns_time32_fromtext(token.value.as_pointer, &time_signed)); RETERR(uint32_tobuffer(time_signed, target)); /* @@ -114,7 +114,7 @@ fromtext_sig(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - RETERR(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); /* * Sig. diff --git a/lib/dns/rdata/generic/soa_6.c b/lib/dns/rdata/generic/soa_6.c index 46b8dcdba1..0c924b4885 100644 --- a/lib/dns/rdata/generic/soa_6.c +++ b/lib/dns/rdata/generic/soa_6.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: soa_6.c,v 1.49 2001/02/12 03:04:56 bwelling Exp $ */ +/* $Id: soa_6.c,v 1.50 2001/03/06 22:11:02 marka Exp $ */ /* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */ @@ -45,7 +45,7 @@ fromtext_soa(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); - RETERR(dns_name_fromtext(&name, &buffer, origin, + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); } @@ -57,7 +57,7 @@ fromtext_soa(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - RETERR(dns_counter_fromtext(&token.value.as_textregion, &n)); + RETTOK(dns_counter_fromtext(&token.value.as_textregion, &n)); RETERR(uint32_tobuffer(n, target)); } diff --git a/lib/dns/rdata/generic/tkey_249.c b/lib/dns/rdata/generic/tkey_249.c index 2bcd8f4da3..e63331ee38 100644 --- a/lib/dns/rdata/generic/tkey_249.c +++ b/lib/dns/rdata/generic/tkey_249.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tkey_249.c,v 1.44 2001/02/12 03:04:58 bwelling Exp $ */ +/* $Id: tkey_249.c,v 1.45 2001/03/06 22:11:04 marka Exp $ */ /* * Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley. @@ -49,7 +49,7 @@ fromtext_tkey(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - RETERR(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); /* @@ -72,7 +72,7 @@ fromtext_tkey(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -85,9 +85,9 @@ fromtext_tkey(ARGS_FROMTEXT) { { i = strtol(token.value.as_pointer, &e, 10); if (*e != 0) - return (DNS_R_UNKNOWN); + RETTOK(DNS_R_UNKNOWN); if (i < 0 || i > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); rcode = (dns_rcode_t)i; } RETERR(uint16_tobuffer(rcode, target)); @@ -98,7 +98,7 @@ fromtext_tkey(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -112,7 +112,7 @@ fromtext_tkey(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* diff --git a/lib/dns/rdata/generic/txt_16.c b/lib/dns/rdata/generic/txt_16.c index a8ad1a1d41..2d424a4f22 100644 --- a/lib/dns/rdata/generic/txt_16.c +++ b/lib/dns/rdata/generic/txt_16.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: txt_16.c,v 1.33 2001/01/09 21:54:51 bwelling Exp $ */ +/* $Id: txt_16.c,v 1.34 2001/03/06 22:11:05 marka Exp $ */ /* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */ @@ -41,7 +41,7 @@ fromtext_txt(ARGS_FROMTEXT) { if (token.type != isc_tokentype_qstring && token.type != isc_tokentype_string) break; - RETERR(txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); } /* Let upper layer handle eol/eof. */ isc_lex_ungettoken(lexer, &token); diff --git a/lib/dns/rdata/generic/x25_19.c b/lib/dns/rdata/generic/x25_19.c index 8a388291c3..2564d0daaa 100644 --- a/lib/dns/rdata/generic/x25_19.c +++ b/lib/dns/rdata/generic/x25_19.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: x25_19.c,v 1.27 2001/01/09 21:54:56 bwelling Exp $ */ +/* $Id: x25_19.c,v 1.28 2001/03/06 22:11:06 marka Exp $ */ /* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */ @@ -40,11 +40,12 @@ fromtext_x25(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); if (token.value.as_textregion.length < 4) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); for (i = 0; i < token.value.as_textregion.length; i++) if (!isdigit(token.value.as_textregion.base[i] & 0xff)) - return (ISC_R_RANGE); - return (txt_fromtext(&token.value.as_textregion, target)); + RETTOK(ISC_R_RANGE); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/hs_4/a_1.c b/lib/dns/rdata/hs_4/a_1.c index a2928f1770..fbb8a95523 100644 --- a/lib/dns/rdata/hs_4/a_1.c +++ b/lib/dns/rdata/hs_4/a_1.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a_1.c,v 1.22 2001/01/25 20:14:38 bwelling Exp $ */ +/* $Id: a_1.c,v 1.23 2001/03/06 22:11:07 marka Exp $ */ /* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */ @@ -43,7 +43,7 @@ fromtext_hs_a(ARGS_FROMTEXT) { ISC_FALSE)); if (inet_aton(token.value.as_pointer, &addr) != 1) - return (DNS_R_BADDOTTEDQUAD); + RETTOK(DNS_R_BADDOTTEDQUAD); isc_buffer_availableregion(target, ®ion); if (region.length < 4) return (ISC_R_NOSPACE); diff --git a/lib/dns/rdata/in_1/a6_38.c b/lib/dns/rdata/in_1/a6_38.c index ce06fe4429..24557acd9e 100644 --- a/lib/dns/rdata/in_1/a6_38.c +++ b/lib/dns/rdata/in_1/a6_38.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a6_38.c,v 1.42 2001/02/12 03:04:59 bwelling Exp $ */ +/* $Id: a6_38.c,v 1.43 2001/03/06 22:11:08 marka Exp $ */ /* draft-ietf-ipngwg-dns-lookups-03.txt */ @@ -47,7 +47,7 @@ fromtext_in_a6(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 128) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); prefixlen = (unsigned char)token.value.as_ulong; RETERR(mem_tobuffer(target, &prefixlen, 1)); @@ -67,7 +67,7 @@ fromtext_in_a6(ARGS_FROMTEXT) { isc_tokentype_string, ISC_FALSE)); if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) - return (DNS_R_BADAAAA); + RETTOK(DNS_R_BADAAAA); mask = 0xff >> (prefixlen % 8); addr[octets] &= mask; RETERR(mem_tobuffer(target, &addr[octets], 16 - octets)); @@ -81,7 +81,8 @@ fromtext_in_a6(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/in_1/a_1.c b/lib/dns/rdata/in_1/a_1.c index 1cd0dc69b4..c1c9a82b3b 100644 --- a/lib/dns/rdata/in_1/a_1.c +++ b/lib/dns/rdata/in_1/a_1.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a_1.c,v 1.43 2001/01/25 20:14:40 bwelling Exp $ */ +/* $Id: a_1.c,v 1.44 2001/03/06 22:11:09 marka Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -45,7 +45,7 @@ fromtext_in_a(ARGS_FROMTEXT) { ISC_FALSE)); if (inet_aton(token.value.as_pointer, &addr) != 1) - return (DNS_R_BADDOTTEDQUAD); + RETTOK(DNS_R_BADDOTTEDQUAD); isc_buffer_availableregion(target, ®ion); if (region.length < 4) return (ISC_R_NOSPACE); diff --git a/lib/dns/rdata/in_1/aaaa_28.c b/lib/dns/rdata/in_1/aaaa_28.c index a25e8cec26..a0a46f0ba6 100644 --- a/lib/dns/rdata/in_1/aaaa_28.c +++ b/lib/dns/rdata/in_1/aaaa_28.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: aaaa_28.c,v 1.33 2001/01/25 20:14:41 bwelling Exp $ */ +/* $Id: aaaa_28.c,v 1.34 2001/03/06 22:11:10 marka Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -45,7 +45,7 @@ fromtext_in_aaaa(ARGS_FROMTEXT) { ISC_FALSE)); if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) - return (DNS_R_BADAAAA); + RETTOK(DNS_R_BADAAAA); isc_buffer_availableregion(target, ®ion); if (region.length < 16) return (ISC_R_NOSPACE); diff --git a/lib/dns/rdata/in_1/kx_36.c b/lib/dns/rdata/in_1/kx_36.c index 6210348122..ffc4f54a68 100644 --- a/lib/dns/rdata/in_1/kx_36.c +++ b/lib/dns/rdata/in_1/kx_36.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: kx_36.c,v 1.34 2001/02/12 03:05:00 bwelling Exp $ */ +/* $Id: kx_36.c,v 1.35 2001/03/06 22:11:12 marka Exp $ */ /* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */ @@ -40,7 +40,7 @@ fromtext_in_kx(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, @@ -48,7 +48,8 @@ fromtext_in_kx(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/in_1/naptr_35.c b/lib/dns/rdata/in_1/naptr_35.c index 68bfb6b271..4f627d0935 100644 --- a/lib/dns/rdata/in_1/naptr_35.c +++ b/lib/dns/rdata/in_1/naptr_35.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: naptr_35.c,v 1.39 2001/02/12 03:05:01 bwelling Exp $ */ +/* $Id: naptr_35.c,v 1.40 2001/03/06 22:11:13 marka Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -43,7 +43,7 @@ fromtext_in_naptr(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -52,7 +52,7 @@ fromtext_in_naptr(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -60,21 +60,21 @@ fromtext_in_naptr(ARGS_FROMTEXT) { */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); - RETERR(txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); /* * Service. */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); - RETERR(txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); /* * Regexp. */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); - RETERR(txt_fromtext(&token.value.as_textregion, target)); + RETTOK(txt_fromtext(&token.value.as_textregion, target)); /* * Replacement. @@ -84,7 +84,8 @@ fromtext_in_naptr(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/in_1/nsap-ptr_23.c b/lib/dns/rdata/in_1/nsap-ptr_23.c index fdc4cbf91f..0d8cd88611 100644 --- a/lib/dns/rdata/in_1/nsap-ptr_23.c +++ b/lib/dns/rdata/in_1/nsap-ptr_23.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsap-ptr_23.c,v 1.29 2001/02/12 03:05:02 bwelling Exp $ */ +/* $Id: nsap-ptr_23.c,v 1.30 2001/03/06 22:11:14 marka Exp $ */ /* Reviewed: Fri Mar 17 10:16:02 PST 2000 by gson */ @@ -43,7 +43,8 @@ fromtext_in_nsap_ptr(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/in_1/nsap_22.c b/lib/dns/rdata/in_1/nsap_22.c index ccdafcf51c..30aaebc6fd 100644 --- a/lib/dns/rdata/in_1/nsap_22.c +++ b/lib/dns/rdata/in_1/nsap_22.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsap_22.c,v 1.29 2001/01/09 21:55:14 bwelling Exp $ */ +/* $Id: nsap_22.c,v 1.30 2001/03/06 22:11:15 marka Exp $ */ /* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */ @@ -46,9 +46,9 @@ fromtext_in_nsap(ARGS_FROMTEXT) { ISC_FALSE)); sr = &token.value.as_textregion; if (sr->length < 2) - return (ISC_R_UNEXPECTEDEND); + RETTOK(ISC_R_UNEXPECTEDEND); if (sr->base[0] != '0' || (sr->base[1] != 'x' && sr->base[1] != 'X')) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); isc_textregion_consume(sr, 2); digits = 0; n = 0; @@ -58,7 +58,7 @@ fromtext_in_nsap(ARGS_FROMTEXT) { continue; } if ((n = hexvalue(sr->base[0])) == -1) - return (DNS_R_SYNTAX); + RETTOK(DNS_R_SYNTAX); c <<= 4; c += n; if (++digits == 2) { @@ -67,9 +67,8 @@ fromtext_in_nsap(ARGS_FROMTEXT) { } isc_textregion_consume(sr, 1); } - if (digits) { - return (ISC_R_UNEXPECTEDEND); - } + if (digits) + RETTOK(ISC_R_UNEXPECTEDEND); return (ISC_R_SUCCESS); } diff --git a/lib/dns/rdata/in_1/px_26.c b/lib/dns/rdata/in_1/px_26.c index 10abbf035e..39196d45c6 100644 --- a/lib/dns/rdata/in_1/px_26.c +++ b/lib/dns/rdata/in_1/px_26.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: px_26.c,v 1.31 2001/02/12 03:05:03 bwelling Exp $ */ +/* $Id: px_26.c,v 1.32 2001/03/06 22:11:16 marka Exp $ */ /* Reviewed: Mon Mar 20 10:44:27 PST 2000 */ @@ -43,7 +43,7 @@ fromtext_in_px(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -54,7 +54,7 @@ fromtext_in_px(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - RETERR(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); /* * MAPX400. @@ -64,7 +64,8 @@ fromtext_in_px(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/in_1/srv_33.c b/lib/dns/rdata/in_1/srv_33.c index 0548695034..5f270575e8 100644 --- a/lib/dns/rdata/in_1/srv_33.c +++ b/lib/dns/rdata/in_1/srv_33.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: srv_33.c,v 1.33 2001/02/12 03:05:05 bwelling Exp $ */ +/* $Id: srv_33.c,v 1.34 2001/03/06 22:11:17 marka Exp $ */ /* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */ @@ -43,7 +43,7 @@ fromtext_in_srv(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -52,7 +52,7 @@ fromtext_in_srv(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -61,7 +61,7 @@ fromtext_in_srv(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* @@ -72,7 +72,8 @@ fromtext_in_srv(ARGS_FROMTEXT) { dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; - return (dns_name_fromtext(&name, &buffer, origin, downcase, target)); + RETTOK(dns_name_fromtext(&name, &buffer, origin, downcase, target)); + return (ISC_R_SUCCESS); } static inline isc_result_t diff --git a/lib/dns/rdata/in_1/wks_11.c b/lib/dns/rdata/in_1/wks_11.c index 1baef05195..982781f8cf 100644 --- a/lib/dns/rdata/in_1/wks_11.c +++ b/lib/dns/rdata/in_1/wks_11.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: wks_11.c,v 1.40 2001/01/25 20:14:42 bwelling Exp $ */ +/* $Id: wks_11.c,v 1.41 2001/03/06 22:11:18 marka Exp $ */ /* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */ @@ -62,7 +62,7 @@ fromtext_in_wks(ARGS_FROMTEXT) { isc_buffer_availableregion(target, ®ion); if (inet_aton(token.value.as_pointer, &addr) != 1) - return (DNS_R_BADDOTTEDQUAD); + RETTOK(DNS_R_BADDOTTEDQUAD); if (region.length < 4) return (ISC_R_NOSPACE); memcpy(region.base, &addr, 4); @@ -80,9 +80,9 @@ fromtext_in_wks(ARGS_FROMTEXT) { else if ((pe = getprotobyname(token.value.as_pointer)) != NULL) proto = pe->p_proto; else - return (ISC_R_UNEXPECTED); + RETTOK(DNS_R_UNKNOWNPROTO); if (proto < 0 || proto > 0xff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (proto == IPPROTO_TCP) ps = "tcp"; @@ -117,9 +117,9 @@ fromtext_in_wks(ARGS_FROMTEXT) { != NULL) port = ntohs(se->s_port); else - return (ISC_R_UNEXPECTED); + RETTOK(DNS_R_UNKNOWNSERVICE); if (port < 0 || port > 0xffff) - return (ISC_R_RANGE); + RETTOK(ISC_R_RANGE); if (port > maxport) maxport = port; bm[port / 8] |= (0x80 >> (port % 8)); diff --git a/lib/dns/result.c b/lib/dns/result.c index 2d41ef6724..45f0f2ce4e 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.86 2001/02/26 01:45:53 marka Exp $ */ +/* $Id: result.c,v 1.87 2001/03/06 22:10:31 marka Exp $ */ #include @@ -100,7 +100,7 @@ static const char *text[DNS_R_NRESULTS] = { "no valid NXT", /* 60 DNS_R_NOVALIDNXT */ "not insecure", /* 61 DNS_R_NOTINSECURE */ - " ", /* 62 unused */ + "unknown service", /* 62 DNS_R_UNKNOWNSERVICE */ "recoverable error occurred", /* 63 DNS_R_RECOVERABLE */ "unknown opt attribute record", /* 64 DNS_R_UNKNOWNOPT */ @@ -115,6 +115,7 @@ static const char *text[DNS_R_NRESULTS] = { "multiple RRs of singleton type", /* 72 DNS_R_SINGLETON */ "hint nxrrset", /* 73 DNS_R_HINTNXRRSET */ "no master file configured" /* 74 DNS_R_NOMASTERFILE */ + "unknown protocol" /* 75 DNS_R_UNKNOWNPROTO */ }; static const char *rcode_text[DNS_R_NRCODERESULTS] = {