Commit 9ac7076e authored by Mark Andrews's avatar Mark Andrews
Browse files

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.
parent 93e66a44
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.
......
......@@ -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.
......
......@@ -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 <config.h>
#include <ctype.h>
......@@ -43,10 +43,19 @@
#include <dns/time.h>
#include <dns/ttl.h>
#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, \
......
......@@ -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));
/*
......
......@@ -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
......
......@@ -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));
......
......@@ -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
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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? */
......
......@@ -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.
*/
......
......@@ -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
......