diff --git a/CHANGES b/CHANGES index 5d978299fd..6b09a9e089 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + 936. [func] Warn when non dotted decimal quad's are used. + [RT #1084] + + 935. [bug] inet_pton failed to reject leading zeros. 934. [port] Deal with systems where accept() spuriously returns ECONNRESET. diff --git a/configure.in b/configure.in index f0d779e995..4741e4fc1a 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.278 $) +AC_REVISION($Revision: 1.279 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.13) @@ -1102,7 +1102,8 @@ AC_TRY_LINK([ # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts -# addresses with less than four octets, like "1.2.3". +# addresses with less than four octets, like "1.2.3". Also leading +# zeros should also be rejected. AC_MSG_CHECKING([for inet_pton]) AC_TRY_RUN([ @@ -1110,7 +1111,8 @@ AC_TRY_RUN([ #include #include #include -main() { char a[4]; return (inet_pton(AF_INET, "1.2.3", a) == 0 ? 0 : 1); }], +main() { char a[4]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 : + inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 0); }], [AC_MSG_RESULT(yes) ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"], [AC_MSG_RESULT(no) diff --git a/lib/dns/gen.c b/lib/dns/gen.c index 7b391a6edc..2874d19893 100644 --- a/lib/dns/gen.c +++ b/lib/dns/gen.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: gen.c,v 1.62 2001/07/06 17:35:04 gson Exp $ */ +/* $Id: gen.c,v 1.63 2001/07/16 03:05:56 marka Exp $ */ #include @@ -34,7 +34,7 @@ #include "gen-unix.h" #endif -#define FROMTEXTARGS "rdclass, type, lexer, origin, downcase, target" +#define FROMTEXTARGS "rdclass, type, lexer, origin, downcase, target, callbacks" #define FROMTEXTCLASS "rdclass" #define FROMTEXTTYPE "type" #define FROMTEXTDEF "result = DNS_R_UNKNOWN" diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 5729dbbb35..926c97f515 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.144 2001/07/06 20:15:08 gson Exp $ */ +/* $Id: rdata.c,v 1.145 2001/07/16 03:05:57 marka Exp $ */ #include #include @@ -60,7 +60,8 @@ #define ARGS_FROMTEXT int rdclass, dns_rdatatype_t type, \ isc_lex_t *lexer, dns_name_t *origin, \ - isc_boolean_t downcase, isc_buffer_t *target + isc_boolean_t downcase, isc_buffer_t *target, \ + dns_rdatacallbacks_t *callbacks #define ARGS_TOTEXT dns_rdata_t *rdata, dns_rdata_textctx_t *tctx, \ isc_buffer_t *target @@ -179,6 +180,25 @@ static isc_result_t rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx, isc_buffer_t *target); +static inline int +getquad(const void *src, struct in_addr *dst, + isc_lex_t *lexer, dns_rdatacallbacks_t *callbacks) +{ + int result; + struct in_addr *tmp; + + result = inet_aton(src, dst); + if (result == 1 && callbacks != NULL && + inet_pton(AF_INET, src, &tmp) != 1) { + (*callbacks->warn)(callbacks, "%s:%lu: warning \"%s\" " + "is not a decimal dotted quad", + isc_lex_getsourcename(lexer), + isc_lex_getsourceline(lexer), + src); + } + return (result); +} + static inline isc_result_t name_duporclone(dns_name_t *source, isc_mem_t *mctx, dns_name_t *target) { diff --git a/lib/dns/rdata/any_255/tsig_250.c b/lib/dns/rdata/any_255/tsig_250.c index 2de6a8f528..776316e90e 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.51 2001/06/21 04:00:28 marka Exp $ */ +/* $Id: tsig_250.c,v 1.52 2001/07/16 03:05:58 marka Exp $ */ /* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */ @@ -40,6 +40,7 @@ fromtext_any_tsig(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Algorithm Name. diff --git a/lib/dns/rdata/generic/afsdb_18.c b/lib/dns/rdata/generic/afsdb_18.c index 90323cfc93..68ac619e4b 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.38 2001/03/16 22:52:33 bwelling Exp $ */ +/* $Id: afsdb_18.c,v 1.39 2001/07/16 03:06:00 marka Exp $ */ /* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */ @@ -36,6 +36,7 @@ fromtext_afsdb(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Subtype. diff --git a/lib/dns/rdata/generic/cert_37.c b/lib/dns/rdata/generic/cert_37.c index 3e0cab84cb..51713502c5 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.39 2001/06/21 04:00:30 marka Exp $ */ +/* $Id: cert_37.c,v 1.40 2001/07/16 03:06:01 marka Exp $ */ /* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */ @@ -38,6 +38,7 @@ fromtext_cert(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); /* * Cert type. diff --git a/lib/dns/rdata/generic/cname_5.c b/lib/dns/rdata/generic/cname_5.c index 299f98e97b..d597b90ea7 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.42 2001/03/16 22:52:36 bwelling Exp $ */ +/* $Id: cname_5.c,v 1.43 2001/07/16 03:06:03 marka Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -35,6 +35,7 @@ fromtext_cname(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/dname_39.c b/lib/dns/rdata/generic/dname_39.c index ad9df71525..2f0d5f2f75 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.33 2001/04/27 21:02:00 gson Exp $ */ +/* $Id: dname_39.c,v 1.34 2001/07/16 03:06:04 marka Exp $ */ /* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */ @@ -36,6 +36,7 @@ fromtext_dname(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/gpos_27.c b/lib/dns/rdata/generic/gpos_27.c index ac8efb19ab..21c31bf60d 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.31 2001/06/21 04:00:31 marka Exp $ */ +/* $Id: gpos_27.c,v 1.32 2001/07/16 03:06:05 marka Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -37,6 +37,7 @@ fromtext_gpos(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); for (i = 0; i < 3 ; i++) { RETERR(isc_lex_getmastertoken(lexer, &token, diff --git a/lib/dns/rdata/generic/hinfo_13.c b/lib/dns/rdata/generic/hinfo_13.c index fd02b40bcb..88017dce27 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.36 2001/06/21 04:00:32 marka Exp $ */ +/* $Id: hinfo_13.c,v 1.37 2001/07/16 03:06:06 marka Exp $ */ /* * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. @@ -35,6 +35,7 @@ fromtext_hinfo(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); REQUIRE(type == 13); diff --git a/lib/dns/rdata/generic/isdn_20.c b/lib/dns/rdata/generic/isdn_20.c index 6ea3554930..f56ea00589 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.29 2001/06/21 04:00:33 marka Exp $ */ +/* $Id: isdn_20.c,v 1.30 2001/07/16 03:06:08 marka Exp $ */ /* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */ @@ -36,6 +36,7 @@ fromtext_isdn(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); /* ISDN-address */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, diff --git a/lib/dns/rdata/generic/key_25.c b/lib/dns/rdata/generic/key_25.c index efe30b2591..d1688be01e 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.40 2001/06/21 04:00:34 marka Exp $ */ +/* $Id: key_25.c,v 1.41 2001/07/16 03:06:09 marka Exp $ */ /* * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. @@ -43,6 +43,7 @@ fromtext_key(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); /* flags */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, diff --git a/lib/dns/rdata/generic/loc_29.c b/lib/dns/rdata/generic/loc_29.c index 9f10f2a99b..199bf57ebe 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.29 2001/03/16 22:52:43 bwelling Exp $ */ +/* $Id: loc_29.c,v 1.30 2001/07/16 03:06:10 marka Exp $ */ /* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */ @@ -56,6 +56,7 @@ fromtext_loc(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); /* * Defaults. diff --git a/lib/dns/rdata/generic/mb_7.c b/lib/dns/rdata/generic/mb_7.c index 09e54edbab..6236b69f48 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.40 2001/03/16 22:52:44 bwelling Exp $ */ +/* $Id: mb_7.c,v 1.41 2001/07/16 03:06:11 marka Exp $ */ /* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */ @@ -34,6 +34,7 @@ fromtext_mb(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/md_3.c b/lib/dns/rdata/generic/md_3.c index 44e33e7fda..fc9dffe1f6 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.42 2001/03/16 22:52:45 bwelling Exp $ */ +/* $Id: md_3.c,v 1.43 2001/07/16 03:06:13 marka Exp $ */ /* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */ @@ -34,6 +34,7 @@ fromtext_md(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/mf_4.c b/lib/dns/rdata/generic/mf_4.c index a22c72180c..250c94a7f1 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.40 2001/03/16 22:52:46 bwelling Exp $ */ +/* $Id: mf_4.c,v 1.41 2001/07/16 03:06:14 marka Exp $ */ /* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */ @@ -34,6 +34,7 @@ fromtext_mf(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/mg_8.c b/lib/dns/rdata/generic/mg_8.c index 889d22a690..4c634a7fb1 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.38 2001/03/16 22:52:47 bwelling Exp $ */ +/* $Id: mg_8.c,v 1.39 2001/07/16 03:06:15 marka Exp $ */ /* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */ @@ -34,6 +34,7 @@ fromtext_mg(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/minfo_14.c b/lib/dns/rdata/generic/minfo_14.c index ef5bf19131..0204640487 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.39 2001/03/16 22:52:49 bwelling Exp $ */ +/* $Id: minfo_14.c,v 1.40 2001/07/16 03:06:17 marka Exp $ */ /* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */ @@ -35,6 +35,7 @@ fromtext_minfo(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); for (i = 0; i < 2 ; i++) { RETERR(isc_lex_getmastertoken(lexer, &token, diff --git a/lib/dns/rdata/generic/mr_9.c b/lib/dns/rdata/generic/mr_9.c index 6f9754f180..7c11a43015 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.37 2001/03/16 22:52:50 bwelling Exp $ */ +/* $Id: mr_9.c,v 1.38 2001/07/16 03:06:18 marka Exp $ */ /* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */ @@ -34,6 +34,7 @@ fromtext_mr(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/mx_15.c b/lib/dns/rdata/generic/mx_15.c index 290edec561..5be0a3aed8 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.47 2001/03/16 22:52:52 bwelling Exp $ */ +/* $Id: mx_15.c,v 1.48 2001/07/16 03:06:19 marka Exp $ */ /* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */ @@ -34,6 +34,7 @@ fromtext_mx(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/ns_2.c b/lib/dns/rdata/generic/ns_2.c index bf09e54e0f..64516c95e0 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.41 2001/03/16 22:52:53 bwelling Exp $ */ +/* $Id: ns_2.c,v 1.42 2001/07/16 03:06:20 marka Exp $ */ /* Reviewed: Wed Mar 15 18:15:00 PST 2000 by bwelling */ @@ -34,6 +34,7 @@ fromtext_ns(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token,isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/null_10.c b/lib/dns/rdata/generic/null_10.c index 36a8d5fac9..918f31c1ba 100644 --- a/lib/dns/rdata/generic/null_10.c +++ b/lib/dns/rdata/generic/null_10.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: null_10.c,v 1.34 2001/06/21 04:00:36 marka Exp $ */ +/* $Id: null_10.c,v 1.35 2001/07/16 03:06:22 marka Exp $ */ /* Reviewed: Thu Mar 16 13:57:50 PST 2000 by explorer */ @@ -34,6 +34,7 @@ fromtext_null(ARGS_FROMTEXT) { UNUSED(origin); UNUSED(downcase); UNUSED(target); + UNUSED(callbacks); return (DNS_R_SYNTAX); } diff --git a/lib/dns/rdata/generic/nxt_30.c b/lib/dns/rdata/generic/nxt_30.c index ac9c9e9e07..c0c719deba 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.48 2001/03/16 22:52:56 bwelling Exp $ */ +/* $Id: nxt_30.c,v 1.49 2001/07/16 03:06:23 marka Exp $ */ /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ @@ -46,6 +46,7 @@ fromtext_nxt(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Next domain. diff --git a/lib/dns/rdata/generic/opt_41.c b/lib/dns/rdata/generic/opt_41.c index f2762b5175..c2d7a75209 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.24 2001/06/21 04:00:37 marka Exp $ */ +/* $Id: opt_41.c,v 1.25 2001/07/16 03:06:24 marka Exp $ */ /* Reviewed: Thu Mar 16 14:06:44 PST 2000 by gson */ @@ -42,6 +42,7 @@ fromtext_opt(ARGS_FROMTEXT) { UNUSED(origin); UNUSED(downcase); UNUSED(target); + UNUSED(callbacks); return (ISC_R_NOTIMPLEMENTED); } diff --git a/lib/dns/rdata/generic/ptr_12.c b/lib/dns/rdata/generic/ptr_12.c index 9a46626ba0..9fccd5b91f 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.38 2001/03/16 22:52:58 bwelling Exp $ */ +/* $Id: ptr_12.c,v 1.39 2001/07/16 03:06:26 marka Exp $ */ /* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */ @@ -34,6 +34,7 @@ fromtext_ptr(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/rp_17.c b/lib/dns/rdata/generic/rp_17.c index c531004fff..0ec376bbdc 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.34 2001/03/16 22:52:59 bwelling Exp $ */ +/* $Id: rp_17.c,v 1.35 2001/07/16 03:06:27 marka Exp $ */ /* RFC 1183 */ @@ -35,6 +35,7 @@ fromtext_rp(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/generic/rt_21.c b/lib/dns/rdata/generic/rt_21.c index 76dcef8e10..ad76382890 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.36 2001/03/16 22:53:00 bwelling Exp $ */ +/* $Id: rt_21.c,v 1.37 2001/07/16 03:06:28 marka Exp $ */ /* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */ @@ -36,6 +36,7 @@ fromtext_rt(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); diff --git a/lib/dns/rdata/generic/sig_24.c b/lib/dns/rdata/generic/sig_24.c index bf24f3ad3c..36d3140efd 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.53 2001/06/21 04:00:38 marka Exp $ */ +/* $Id: sig_24.c,v 1.54 2001/07/16 03:06:29 marka Exp $ */ /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ @@ -42,6 +42,7 @@ fromtext_sig(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Type covered. diff --git a/lib/dns/rdata/generic/soa_6.c b/lib/dns/rdata/generic/soa_6.c index a2484bf546..4de3f2bb1a 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.51 2001/03/16 22:53:02 bwelling Exp $ */ +/* $Id: soa_6.c,v 1.52 2001/07/16 03:06:31 marka Exp $ */ /* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */ @@ -36,6 +36,7 @@ fromtext_soa(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/generic/tkey_249.c b/lib/dns/rdata/generic/tkey_249.c index 7dd78fdf6c..159cfda4d3 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.47 2001/06/21 04:00:39 marka Exp $ */ +/* $Id: tkey_249.c,v 1.48 2001/07/16 03:06:32 marka Exp $ */ /* * Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley. @@ -41,6 +41,7 @@ fromtext_tkey(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Algorithm. diff --git a/lib/dns/rdata/generic/txt_16.c b/lib/dns/rdata/generic/txt_16.c index 8052c2dd2d..989f176306 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.36 2001/06/21 04:00:41 marka Exp $ */ +/* $Id: txt_16.c,v 1.37 2001/07/16 03:06:33 marka Exp $ */ /* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */ @@ -35,6 +35,7 @@ fromtext_txt(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); strings = 0; for (;;) { diff --git a/lib/dns/rdata/generic/unspec_103.c b/lib/dns/rdata/generic/unspec_103.c index 0a9e83246a..afcb9a7584 100644 --- a/lib/dns/rdata/generic/unspec_103.c +++ b/lib/dns/rdata/generic/unspec_103.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: unspec_103.c,v 1.27 2001/06/21 04:00:42 marka Exp $ */ +/* $Id: unspec_103.c,v 1.28 2001/07/16 03:06:35 marka Exp $ */ #ifndef RDATA_GENERIC_UNSPEC_103_C #define RDATA_GENERIC_UNSPEC_103_C @@ -31,6 +31,7 @@ fromtext_unspec(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); return (atob_tobuffer(lexer, target)); } diff --git a/lib/dns/rdata/generic/x25_19.c b/lib/dns/rdata/generic/x25_19.c index 5710154e9d..272c5695df 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.30 2001/06/21 04:00:43 marka Exp $ */ +/* $Id: x25_19.c,v 1.31 2001/07/16 03:06:36 marka Exp $ */ /* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */ @@ -37,6 +37,7 @@ fromtext_x25(ARGS_FROMTEXT) { UNUSED(rdclass); UNUSED(origin); UNUSED(downcase); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); diff --git a/lib/dns/rdata/hs_4/a_1.c b/lib/dns/rdata/hs_4/a_1.c index 2ad87c49f1..2fbc7cb48b 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.24 2001/03/16 22:53:08 bwelling Exp $ */ +/* $Id: a_1.c,v 1.25 2001/07/16 03:06:37 marka Exp $ */ /* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */ @@ -43,7 +43,7 @@ fromtext_hs_a(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - if (inet_aton(token.value.as_pointer, &addr) != 1) + if (getquad(token.value.as_pointer, &addr, lexer, callbacks) != 1) RETTOK(DNS_R_BADDOTTEDQUAD); isc_buffer_availableregion(target, ®ion); if (region.length < 4) diff --git a/lib/dns/rdata/in_1/a6_38.c b/lib/dns/rdata/in_1/a6_38.c index f975c129cb..62ceb46264 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.44 2001/03/16 22:53:10 bwelling Exp $ */ +/* $Id: a6_38.c,v 1.45 2001/07/16 03:06:39 marka Exp $ */ /* draft-ietf-ipngwg-dns-lookups-03.txt */ @@ -41,6 +41,7 @@ fromtext_in_a6(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Prefix length. diff --git a/lib/dns/rdata/in_1/a_1.c b/lib/dns/rdata/in_1/a_1.c index 58514ea909..e731e586eb 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.45 2001/03/16 22:53:11 bwelling Exp $ */ +/* $Id: a_1.c,v 1.46 2001/07/16 03:06:40 marka Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -45,7 +45,7 @@ fromtext_in_a(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - if (inet_aton(token.value.as_pointer, &addr) != 1) + if (getquad(token.value.as_pointer, &addr, lexer, callbacks) != 1) RETTOK(DNS_R_BADDOTTEDQUAD); isc_buffer_availableregion(target, ®ion); if (region.length < 4) diff --git a/lib/dns/rdata/in_1/aaaa_28.c b/lib/dns/rdata/in_1/aaaa_28.c index 7c7d3704e8..d6089f3c98 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.35 2001/03/16 22:53:12 bwelling Exp $ */ +/* $Id: aaaa_28.c,v 1.36 2001/07/16 03:06:41 marka Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -41,6 +41,7 @@ fromtext_in_aaaa(ARGS_FROMTEXT) { UNUSED(origin); UNUSED(downcase); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/in_1/kx_36.c b/lib/dns/rdata/in_1/kx_36.c index 15128da292..3795f2cec8 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.36 2001/03/16 22:53:13 bwelling Exp $ */ +/* $Id: kx_36.c,v 1.37 2001/07/16 03:06:43 marka Exp $ */ /* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */ @@ -37,6 +37,7 @@ fromtext_in_kx(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); diff --git a/lib/dns/rdata/in_1/naptr_35.c b/lib/dns/rdata/in_1/naptr_35.c index 808a2b39e3..292b50ef9f 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.42 2001/06/21 04:00:45 marka Exp $ */ +/* $Id: naptr_35.c,v 1.43 2001/07/16 03:06:44 marka Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -37,6 +37,7 @@ fromtext_in_naptr(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Order. diff --git a/lib/dns/rdata/in_1/nsap-ptr_23.c b/lib/dns/rdata/in_1/nsap-ptr_23.c index e396b924bb..adad651d3a 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.31 2001/03/16 22:53:15 bwelling Exp $ */ +/* $Id: nsap-ptr_23.c,v 1.32 2001/07/16 03:06:46 marka Exp $ */ /* Reviewed: Fri Mar 17 10:16:02 PST 2000 by gson */ @@ -37,6 +37,7 @@ fromtext_in_nsap_ptr(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); diff --git a/lib/dns/rdata/in_1/nsap_22.c b/lib/dns/rdata/in_1/nsap_22.c index 244aad1838..971d55bceb 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.32 2001/06/21 04:00:46 marka Exp $ */ +/* $Id: nsap_22.c,v 1.33 2001/07/16 03:06:47 marka Exp $ */ /* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */ @@ -41,6 +41,7 @@ fromtext_in_nsap(ARGS_FROMTEXT) { UNUSED(origin); UNUSED(downcase); UNUSED(rdclass); + UNUSED(callbacks); /* 0x */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, diff --git a/lib/dns/rdata/in_1/px_26.c b/lib/dns/rdata/in_1/px_26.c index df6afbc00c..e5f8588d94 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.33 2001/03/16 22:53:17 bwelling Exp $ */ +/* $Id: px_26.c,v 1.34 2001/07/16 03:06:48 marka Exp $ */ /* Reviewed: Mon Mar 20 10:44:27 PST 2000 */ @@ -37,6 +37,7 @@ fromtext_in_px(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Preference. diff --git a/lib/dns/rdata/in_1/srv_33.c b/lib/dns/rdata/in_1/srv_33.c index c85bea802e..5c33bdc225 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.35 2001/03/16 22:53:18 bwelling Exp $ */ +/* $Id: srv_33.c,v 1.36 2001/07/16 03:06:49 marka Exp $ */ /* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */ @@ -37,6 +37,7 @@ fromtext_in_srv(ARGS_FROMTEXT) { UNUSED(type); UNUSED(rdclass); + UNUSED(callbacks); /* * Priority. diff --git a/lib/dns/rdata/in_1/wks_11.c b/lib/dns/rdata/in_1/wks_11.c index 8abcb4b686..d094a59916 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.43 2001/06/21 04:00:47 marka Exp $ */ +/* $Id: wks_11.c,v 1.44 2001/07/16 03:06:51 marka Exp $ */ /* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */ @@ -62,7 +62,7 @@ fromtext_in_wks(ARGS_FROMTEXT) { ISC_FALSE)); isc_buffer_availableregion(target, ®ion); - if (inet_aton(token.value.as_pointer, &addr) != 1) + if (getquad(token.value.as_pointer, &addr, lexer, callbacks) != 1) RETTOK(DNS_R_BADDOTTEDQUAD); if (region.length < 4) return (ISC_R_NOSPACE); diff --git a/lib/isc/inet_pton.c b/lib/isc/inet_pton.c index 4db382c64c..789403dcab 100644 --- a/lib/isc/inet_pton.c +++ b/lib/isc/inet_pton.c @@ -17,7 +17,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = - "$Id: inet_pton.c,v 1.9 2001/01/09 21:56:09 bwelling Exp $"; + "$Id: inet_pton.c,v 1.10 2001/07/16 03:06:52 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -96,10 +96,12 @@ inet_pton4(src, dst) if ((pch = strchr(digits, ch)) != NULL) { unsigned int new = *tp * 10 + (pch - digits); + if (saw_digit && *tp == 0) + return (0); if (new > 255) return (0); *tp = new; - if (! saw_digit) { + if (!saw_digit) { if (++octets > 4) return (0); saw_digit = 1; diff --git a/lib/isc/unix/include/isc/net.h b/lib/isc/unix/include/isc/net.h index 29d694889a..9b51c49316 100644 --- a/lib/isc/unix/include/isc/net.h +++ b/lib/isc/unix/include/isc/net.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: net.h,v 1.30 2001/07/09 08:07:41 marka Exp $ */ +/* $Id: net.h,v 1.31 2001/07/16 03:06:53 marka Exp $ */ #ifndef ISC_NET_H #define ISC_NET_H 1 @@ -252,6 +252,7 @@ isc_net_ntop(int af, const void *src, char *dst, size_t size); #ifdef ISC_PLATFORM_NEEDPTON int isc_net_pton(int af, const char *src, void *dst); +#undef inet_pton #define inet_pton isc_net_pton #endif