summaryrefslogtreecommitdiffstats
path: root/contrib/bind/lib
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2001-07-30 16:51:36 +0000
committerasmodai <asmodai@FreeBSD.org>2001-07-30 16:51:36 +0000
commit4764c8658fdd2787fdd421279037fe93eb05ac7c (patch)
tree575f66c4e2766172b1fb832ef43000016e089b3c /contrib/bind/lib
parentc56e32d41edb68ef6a2360025bff9df4a544e5fa (diff)
downloadFreeBSD-src-4764c8658fdd2787fdd421279037fe93eb05ac7c.zip
FreeBSD-src-4764c8658fdd2787fdd421279037fe93eb05ac7c.tar.gz
Virgin import of BIND v8.2.4-REL
Diffstat (limited to 'contrib/bind/lib')
-rw-r--r--contrib/bind/lib/dst/bsafe_link.c11
-rw-r--r--contrib/bind/lib/dst/cylink_link.c14
-rw-r--r--contrib/bind/lib/dst/dst_api.c43
-rw-r--r--contrib/bind/lib/dst/eay_dss_link.c14
-rw-r--r--contrib/bind/lib/dst/prandom.c5
-rw-r--r--contrib/bind/lib/dst/rsaref_link.c13
-rw-r--r--contrib/bind/lib/dst/support.c21
-rw-r--r--contrib/bind/lib/inet/nsap_addr.c10
-rw-r--r--contrib/bind/lib/irs/gethostent.c5
-rw-r--r--contrib/bind/lib/isc/ev_timers.c4
-rw-r--r--contrib/bind/lib/isc/memcluster.c14
-rw-r--r--contrib/bind/lib/nameser/ns_print.c4
-rw-r--r--contrib/bind/lib/resolv/res_debug.c6
-rw-r--r--contrib/bind/lib/resolv/res_init.c9
-rw-r--r--contrib/bind/lib/resolv/res_send.c6
-rw-r--r--contrib/bind/lib/resolv/res_update.c5
16 files changed, 99 insertions, 85 deletions
diff --git a/contrib/bind/lib/dst/bsafe_link.c b/contrib/bind/lib/dst/bsafe_link.c
index 7d9345e..ec072b3 100644
--- a/contrib/bind/lib/dst/bsafe_link.c
+++ b/contrib/bind/lib/dst/bsafe_link.c
@@ -1,5 +1,5 @@
#if defined(BSAFE) || defined(DNSSAFE)
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/bsafe_link.c,v 1.11 1999/10/13 16:39:22 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/bsafe_link.c,v 1.12 2001/04/05 21:59:59 bwelling Exp $";
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -489,8 +489,6 @@ dst_bsafe_from_dns_key(DST_KEY *s_key, const u_char *key, const int len)
B_SetKeyInfo(r_key->rk_Public_Key, KI_RSAPublic, (POINTER) public);
- s_key->dk_id = (u_int16_t)
- dst_s_get_int16(&public->modulus.data[public->modulus.len - 3]);
s_key->dk_key_size = dst_bsafe_key_size(r_key);
SAFE_FREE(public->modulus.data);
SAFE_FREE(public->exponent.data);
@@ -750,8 +748,6 @@ dst_bsafe_key_from_file_format(DST_KEY *d_key, const char *buff,
if (status)
return (-1);
- tag = (int)(u_int16_t)
- dst_s_get_int16(&public->modulus.data[public->modulus.len - 3]);
d_key->dk_key_size = dst_bsafe_key_size(b_key);
SAFE_FREE(private->modulus.data);
@@ -766,7 +762,7 @@ dst_bsafe_key_from_file_format(DST_KEY *d_key, const char *buff,
SAFE_FREE(public->modulus.data);
SAFE_FREE(public->exponent.data);
SAFE_FREE(public);
- return (tag);
+ return (0);
}
@@ -925,10 +921,7 @@ dst_bsafe_generate_keypair(DST_KEY *key, int exp)
rsa->rk_Public_Key = public;
key->dk_KEY_struct = (void *) rsa;
- /* fill in the footprint on generate key */
B_GetKeyInfo((POINTER *) &pk_access, public, KI_RSAPublic);
- key->dk_id = (u_int16_t)
- dst_s_get_int16(&pk_access->modulus.data[pk_access->modulus.len - 3]);
return (1);
}
diff --git a/contrib/bind/lib/dst/cylink_link.c b/contrib/bind/lib/dst/cylink_link.c
index 0638ef1..60097f5 100644
--- a/contrib/bind/lib/dst/cylink_link.c
+++ b/contrib/bind/lib/dst/cylink_link.c
@@ -1,5 +1,5 @@
#ifdef CYLINK_DSS
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/cylink_link.c,v 1.7 1999/10/13 16:39:22 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/cylink_link.c,v 1.8 2001/04/05 22:00:00 bwelling Exp $";
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -373,7 +373,6 @@ dst_cylink_from_dns_key(DST_KEY *s_key, const u_char *key, const int len)
memcpy(d_key->dk_y, key_ptr, d_key->dk_p_bytes);
key_ptr += d_key->dk_p_bytes;
- s_key->dk_id = dst_s_id_calc(key, len);
s_key->dk_key_size = d_key->dk_p_bytes * 8;
return (1);
}
@@ -470,9 +469,7 @@ dst_cylink_key_from_file_format(DST_KEY *d_key, const char *buff,
const int buff_len)
{
u_char s[DSS_LENGTH_MAX];
- u_char dns[1024];
int len, s_len = sizeof(s);
- int foot = -1, dnslen;
const char *p = buff;
DSA_Key *dsa_key;
@@ -534,10 +531,8 @@ dst_cylink_key_from_file_format(DST_KEY *d_key, const char *buff,
} /* while p */
d_key->dk_key_size = dsa_key->dk_p_bytes * 8;
- dnslen = d_key->dk_func->to_dns_key(d_key, dns, sizeof(dns));
- foot = dst_s_id_calc(dns, dnslen);
- return (foot);
+ return (0);
}
@@ -577,10 +572,9 @@ dst_cylink_free_key_structure(void *key)
static int
dst_cylink_generate_keypair(DST_KEY *key, int nothing)
{
- int status, dnslen, n;
+ int status, n;
DSA_Key *dsa;
u_char rand[SHA_LENGTH];
- u_char dns[1024];
if (key == NULL || key->dk_alg != KEY_DSA)
return (0);
@@ -615,8 +609,6 @@ dst_cylink_generate_keypair(DST_KEY *key, int nothing)
return (0);
memset(rand, 0, sizeof(rand));
key->dk_KEY_struct = (void *) dsa;
- dnslen = key->dk_func->to_dns_key(key, dns, sizeof(dns));
- key->dk_id = dst_s_id_calc(dns, dnslen);
return (1);
}
diff --git a/contrib/bind/lib/dst/dst_api.c b/contrib/bind/lib/dst/dst_api.c
index e32d075..c296fdd 100644
--- a/contrib/bind/lib/dst/dst_api.c
+++ b/contrib/bind/lib/dst/dst_api.c
@@ -1,5 +1,5 @@
#ifndef LINT
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/dst_api.c,v 1.16 2000/11/13 04:09:23 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/dst_api.c,v 1.17 2001/04/05 22:00:02 bwelling Exp $";
#endif
/*
@@ -657,6 +657,7 @@ dst_dnskey_to_key(const char *in_name, const u_char *rdata, const int len)
if (in_name == NULL)
return (NULL);
+ key_st->dk_id = dst_s_dns_key_id(rdata, len);
key_st->dk_flags = dst_s_get_int16(rdata);
key_st->dk_proto = (u_int16_t) rdata[DST_KEY_PROT];
if (key_st->dk_flags & DST_EXTEND_FLAG) {
@@ -760,6 +761,8 @@ dst_buffer_to_key(const char *key_name, /* name of the key */
{
DST_KEY *dkey = NULL;
+ int dnslen;
+ u_char dns[2048];
if (!dst_check_algorithm(alg)) { /* make sure alg is available */
EREPORT(("dst_buffer_to_key(): Algorithm %d not suppored\n", alg));
@@ -771,14 +774,17 @@ dst_buffer_to_key(const char *key_name, /* name of the key */
if (dkey == NULL)
return (NULL);
- if (dkey->dk_func != NULL && dkey->dk_func->from_dns_key != NULL) {
- if (dkey->dk_func->from_dns_key(dkey, key_buf, key_len) < 0) {
- EREPORT(("dst_buffer_to_key(): dst_buffer_to_hmac failed\n"));
- return (dst_free_key(dkey));
- }
- return (dkey);
+ if (dkey->dk_func == NULL || dkey->dk_func->from_dns_key == NULL)
+ return NULL;
+
+ if (dkey->dk_func->from_dns_key(dkey, key_buf, key_len) < 0) {
+ EREPORT(("dst_buffer_to_key(): dst_buffer_to_hmac failed\n"));
+ return (dst_free_key(dkey));
}
- return (NULL);
+
+ dnslen = dst_key_to_dnskey(dkey, dns, sizeof(dns));
+ dkey->dk_id = dst_s_dns_key_id(dns, dnslen);
+ return (dkey);
}
int
@@ -816,10 +822,12 @@ dst_s_read_private_key_file(char *name, DST_KEY *pk_key, u_int16_t in_id,
int in_alg)
{
int cnt, alg, len, major, minor, file_major, file_minor;
- int id;
+ int ret, id;
char filename[PATH_MAX];
u_char in_buff[RAW_KEY_SIZE], *p;
FILE *fp;
+ int dnslen;
+ u_char dns[2048];
if (name == NULL || pk_key == NULL) {
EREPORT(("dst_read_private_key_file(): No key name given\n"));
@@ -886,10 +894,13 @@ dst_s_read_private_key_file(char *name, DST_KEY *pk_key, u_int16_t in_id,
if (pk_key->dk_func == NULL || pk_key->dk_func->from_file_fmt == NULL)
goto fail;
- id = pk_key->dk_func->from_file_fmt(pk_key, (char *)p, &in_buff[len] - p);
- if (id < 0)
+ ret = pk_key->dk_func->from_file_fmt(pk_key, (char *)p, &in_buff[len] - p);
+ if (ret < 0)
goto fail;
+ dnslen = dst_key_to_dnskey(pk_key, dns, sizeof(dns));
+ id = dst_s_dns_key_id(dns, dnslen);
+
/* Make sure the actual key tag matches the input tag used in the filename
*/
if (id != in_id) {
@@ -942,6 +953,9 @@ dst_generate_key(const char *name, const int bits, const int exp,
{
DST_KEY *new_key = NULL;
int res;
+ int dnslen;
+ u_char dns[2048];
+
if (name == NULL)
return (NULL);
@@ -966,6 +980,13 @@ dst_generate_key(const char *name, const int bits, const int exp,
new_key->dk_key_size, exp));
return (dst_free_key(new_key));
}
+
+ dnslen = dst_key_to_dnskey(new_key, dns, sizeof(dns));
+ if (dnslen != UNSUPPORTED_KEYALG)
+ new_key->dk_id = dst_s_dns_key_id(dns, dnslen);
+ else
+ new_key->dk_id = 0;
+
return (new_key);
}
diff --git a/contrib/bind/lib/dst/eay_dss_link.c b/contrib/bind/lib/dst/eay_dss_link.c
index 8542149..0cc01a8 100644
--- a/contrib/bind/lib/dst/eay_dss_link.c
+++ b/contrib/bind/lib/dst/eay_dss_link.c
@@ -1,5 +1,5 @@
#ifdef EAY_DSS
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/eay_dss_link.c,v 1.4 1999/10/13 16:39:23 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/eay_dss_link.c,v 1.5 2001/04/05 22:00:03 bwelling Exp $";
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -341,7 +341,6 @@ dst_eay_dss_from_dns_key(DST_KEY *s_key, const u_char *key, const int len)
d_key->pub_key = BN_bin2bn(key_ptr, p_bytes, NULL);
key_ptr += p_bytes;
- s_key->dk_id = dst_s_id_calc(key, len);
s_key->dk_key_size = p_bytes * 8;
return (1);
}
@@ -442,9 +441,7 @@ dst_eay_dss_key_from_file_format(DST_KEY *d_key, const u_char *buff,
const int buff_len)
{
char s[128];
- char dns[1024];
int len, s_len = sizeof(s);
- int foot = -1, dnslen;
const char *p = buff;
DSA *dsa_key;
@@ -499,10 +496,8 @@ dst_eay_dss_key_from_file_format(DST_KEY *d_key, const u_char *buff,
} /* while p */
d_key->dk_key_size = BN_num_bytes(dsa_key->p);
- dnslen = d_key->dk_func->to_dns_key(d_key, dns, sizeof(dns));
- foot = dst_s_id_calc(dns, dnslen);
- return (foot);
+ return (0);
}
@@ -543,10 +538,9 @@ dst_eay_dss_free_key_structure(void *key)
static int
dst_eay_dss_generate_keypair(DST_KEY *key, int nothing)
{
- int status, dnslen, n;
+ int status, n;
DSA *dsa;
u_char rand[SHA_DIGEST_LENGTH];
- char dns[1024];
if (key == NULL || key->dk_alg != KEY_DSA)
return (0);
@@ -572,8 +566,6 @@ dst_eay_dss_generate_keypair(DST_KEY *key, int nothing)
return(0);
}
key->dk_KEY_struct = (void *) dsa;
- dnslen = key->dk_func->to_dns_key(key, dns, sizeof(dns));
- key->dk_id = dst_s_id_calc(dns, dnslen);
return (1);
}
diff --git a/contrib/bind/lib/dst/prandom.c b/contrib/bind/lib/dst/prandom.c
index a17e071..031da2e 100644
--- a/contrib/bind/lib/dst/prandom.c
+++ b/contrib/bind/lib/dst/prandom.c
@@ -1,5 +1,5 @@
#ifndef LINT
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/prandom.c,v 1.9 2000/07/17 07:36:53 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/prandom.c,v 1.10 2001/02/12 23:13:46 marka Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -204,7 +204,6 @@ do_time(dst_work *work)
zone = (struct timezone *) tmp;
mtime = (struct timeval *)(tmp + sizeof(struct timezone));
gettimeofday(mtime, zone);
- assert(mtime->tv_usec >= 0 && mtime->tv_usec < 1000000);
cnt = sizeof(tmp);
my_digest(work, tmp, sizeof(tmp));
@@ -252,7 +251,7 @@ do_ls(dst_work *work)
if (stat(dirs[i++], &buf)) /* directory does not exist */
return (0);
- gettimeofday(&tv,NULL);
+ gettimeofday(&tv, NULL);
if (d_round == 0)
d_round = tv.tv_sec - MAX_OLD;
else if (i==1) /* if starting a new round cut what we accept */
diff --git a/contrib/bind/lib/dst/rsaref_link.c b/contrib/bind/lib/dst/rsaref_link.c
index 52a49b4..a45b6f7 100644
--- a/contrib/bind/lib/dst/rsaref_link.c
+++ b/contrib/bind/lib/dst/rsaref_link.c
@@ -1,5 +1,5 @@
#ifdef RSAREF
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/rsaref_link.c,v 1.7 2000/07/17 07:36:53 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/rsaref_link.c,v 1.9 2001/04/05 22:00:04 bwelling Exp $";
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -357,8 +357,6 @@ dst_rsaref_from_dns_key(DST_KEY *s_key, const u_char *key, const int len)
memcpy(&r_key->rk_Public_Key->modulus[MAX_RSA_MODULUS_LEN - bytes],
key_ptr, bytes);
r_key->rk_Public_Key->bits = bytes * 8;
- s_key->dk_id = (u_int16_t) dst_s_get_int16((u_char *)
- &r_key->rk_Public_Key->modulus[MAX_RSA_MODULUS_LEN - 3]);
s_key->dk_key_size = r_key->rk_Public_Key->bits;
return (1);
@@ -544,10 +542,8 @@ dst_rsaref_key_from_file_format(DST_KEY *d_key, const u_char *buff,
r_key->rk_signer = strdup(d_key->dk_key_name);
d_key->dk_KEY_struct = (void *) r_key;
d_key->dk_key_size = r_key->rk_Private_Key->bits;
- d_key->dk_id = (u_int16_t) dst_s_get_int16((u_char *)
- &r_key->rk_Public_Key->modulus[MAX_RSA_MODULUS_LEN - 3]);
- foot = (int) d_key->dk_id;
- return (foot);
+
+ return (0);
}
@@ -646,8 +642,6 @@ dst_rsaref_generate_keypair(DST_KEY *key, const int exp)
rsa->rk_Public_Key = public;
key->dk_KEY_struct = (void *) rsa;
- key->dk_id = (u_int16_t) dst_s_get_int16((u_char *)
- &rsa->rk_Public_Key->modulus[MAX_RSA_MODULUS_LEN - 3]);
return (1);
}
@@ -706,7 +700,6 @@ dst_rsaref_init_random_struct(R_RANDOM_STRUCT * randomstruct)
* This must be the FIRST CALL
*/
gettimeofday(&tv, 0);
- assert(tv.tv_usec >= 0 && tv.tv_usec < 1000000);
R_RandomUpdate(randomstruct, (u_char *) &tv,
sizeof(struct timeval));
diff --git a/contrib/bind/lib/dst/support.c b/contrib/bind/lib/dst/support.c
index d07df5a..d191eb4 100644
--- a/contrib/bind/lib/dst/support.c
+++ b/contrib/bind/lib/dst/support.c
@@ -1,4 +1,4 @@
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/support.c,v 1.8 1999/10/13 16:39:24 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/support.c,v 1.9 2001/04/05 22:00:06 bwelling Exp $";
/*
@@ -200,7 +200,7 @@ dst_s_calculate_bits(const u_char *str, const int max_bits)
/*
- * calculates a checksum used in kmt for a id.
+ * calculates a checksum used in dst for an id.
* takes an array of bytes and a length.
* returns a 16 bit checksum.
*/
@@ -225,34 +225,27 @@ dst_s_id_calc(const u_char *key, const int keysize)
}
/*
- * dst_s_dns_key_id() Function to calculated DNSSEC footprint from KEY reocrd
- * rdata (all of record)
+ * dst_s_dns_key_id() Function to calculate DNSSEC footprint from KEY record
+ * rdata
* Input:
* dns_key_rdata: the raw data in wire format
* rdata_len: the size of the input data
* Output:
- * the key footprint/id calcuated from the key data
+ * the key footprint/id calculated from the key data
*/
u_int16_t
dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len)
{
- int key_data = 4;
-
- if (!dns_key_rdata || (rdata_len < key_data))
+ if (!dns_key_rdata)
return 0;
- /* check the extended parameters bit in the DNS Key RR flags */
- if (dst_s_get_int16(dns_key_rdata) & DST_EXTEND_FLAG)
- key_data += 2;
-
/* compute id */
if (dns_key_rdata[3] == KEY_RSA) /* Algorithm RSA */
return dst_s_get_int16((u_char *)
&dns_key_rdata[rdata_len - 3]);
else
/* compute a checksum on the key part of the key rr */
- return dst_s_id_calc(&dns_key_rdata[key_data],
- (rdata_len - key_data));
+ return dst_s_id_calc(dns_key_rdata, rdata_len);
}
/*
diff --git a/contrib/bind/lib/inet/nsap_addr.c b/contrib/bind/lib/inet/nsap_addr.c
index b28acec..da388dc 100644
--- a/contrib/bind/lib/inet/nsap_addr.c
+++ b/contrib/bind/lib/inet/nsap_addr.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: nsap_addr.c,v 8.10 1999/10/13 16:39:28 vixie Exp $";
+static const char rcsid[] = "$Id: nsap_addr.c,v 8.11 2001/03/26 07:04:30 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -44,6 +44,9 @@ inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) {
u_char c, nib;
u_int len = 0;
+ if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X'))
+ return (0);
+
while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
if (c == '.' || c == '+' || c == '/')
continue;
@@ -75,7 +78,7 @@ char *
inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
int nib;
int i;
- static char tmpbuf[255*3];
+ static char tmpbuf[2+255*3];
char *start;
if (ascii)
@@ -85,6 +88,9 @@ inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
start = tmpbuf;
}
+ *ascii = '0';
+ *ascii = 'x';
+
if (binlen > 255)
binlen = 255;
diff --git a/contrib/bind/lib/irs/gethostent.c b/contrib/bind/lib/irs/gethostent.c
index 5d316c8..5aa46c5 100644
--- a/contrib/bind/lib/irs/gethostent.c
+++ b/contrib/bind/lib/irs/gethostent.c
@@ -16,7 +16,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: gethostent.c,v 1.27 2000/04/20 07:10:33 vixie Exp $";
+static const char rcsid[] = "$Id: gethostent.c,v 1.28 2001/03/01 05:47:44 marka Exp $";
#endif
/* Imports */
@@ -138,7 +138,8 @@ gethostbyname2_p(const char *name, int af, struct net_data *net_data) {
if (!net_data || !(ho = net_data->ho))
return (NULL);
- if (net_data->ho_stayopen && net_data->ho_last) {
+ if (net_data->ho_stayopen && net_data->ho_last &&
+ net_data->ho_last->h_addrtype == af) {
if (ns_samename(name, net_data->ho_last->h_name) == 1)
return (net_data->ho_last);
for (hap = net_data->ho_last->h_aliases; hap && *hap; hap++)
diff --git a/contrib/bind/lib/isc/ev_timers.c b/contrib/bind/lib/isc/ev_timers.c
index ff44e49..e5e5684 100644
--- a/contrib/bind/lib/isc/ev_timers.c
+++ b/contrib/bind/lib/isc/ev_timers.c
@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: ev_timers.c,v 1.26 2000/07/17 07:36:54 vixie Exp $";
+static const char rcsid[] = "$Id: ev_timers.c,v 1.30 2001/02/12 23:13:48 marka Exp $";
#endif
/* Import. */
@@ -38,6 +38,7 @@ static const char rcsid[] = "$Id: ev_timers.c,v 1.26 2000/07/17 07:36:54 vixie E
/* Constants. */
+#define MILLION 1000000
#define BILLION 1000000000
/* Forward. */
@@ -111,7 +112,6 @@ evNowTime() {
if (gettimeofday(&now, NULL) < 0)
return (evConsTime(0, 0));
- INSIST(now.tv_usec >= 0 && now.tv_usec < 1000000);
return (evTimeSpec(now));
}
diff --git a/contrib/bind/lib/isc/memcluster.c b/contrib/bind/lib/isc/memcluster.c
index b775fa7..d565c05 100644
--- a/contrib/bind/lib/isc/memcluster.c
+++ b/contrib/bind/lib/isc/memcluster.c
@@ -20,10 +20,11 @@
bigger and some debugging info stuck before and after the region given
back to the caller. */
/* #define DEBUGGING_MEMCLUSTER */
+#define MEMCLUSTER_ATEND
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: memcluster.c,v 8.19 1999/10/13 17:11:22 vixie Exp $";
+static const char rcsid[] = "$Id: memcluster.c,v 8.20 2001/02/13 23:14:54 marka Exp $";
#endif /* not lint */
#include "port_before.h"
@@ -397,8 +398,19 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
e->file = file;
e->line = line;
#endif
+#ifdef MEMCLUSTER_ATEND
+ e->next = NULL;
+ el = freelists[new_size];
+ while (el != NULL && el->next != NULL)
+ el = el->next;
+ if (el)
+ el->next = e;
+ else
+ freelists[new_size] = e;
+#else
e->next = freelists[new_size];
freelists[new_size] = (void *)e;
+#endif
#else
((memcluster_element *)mem)->next = freelists[new_size];
freelists[new_size] = (memcluster_element *)mem;
diff --git a/contrib/bind/lib/nameser/ns_print.c b/contrib/bind/lib/nameser/ns_print.c
index 41b4d65..7348e1d 100644
--- a/contrib/bind/lib/nameser/ns_print.c
+++ b/contrib/bind/lib/nameser/ns_print.c
@@ -16,7 +16,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_print.c,v 8.21 2000/12/09 00:15:38 marka Exp $";
+static const char rcsid[] = "$Id: ns_print.c,v 8.22 2001/03/26 07:04:31 marka Exp $";
#endif
/* Import. */
@@ -316,7 +316,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
break;
case ns_t_nsap: {
- char t[255*3];
+ char t[2+255*3];
(void) inet_nsap_ntoa(rdlen, rdata, t);
T(addstr(t, strlen(t), &buf, &buflen));
diff --git a/contrib/bind/lib/resolv/res_debug.c b/contrib/bind/lib/resolv/res_debug.c
index 7f2453a..cff6473 100644
--- a/contrib/bind/lib/resolv/res_debug.c
+++ b/contrib/bind/lib/resolv/res_debug.c
@@ -95,7 +95,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_debug.c,v 8.37 2000/11/13 05:22:53 vixie Exp $";
+static const char rcsid[] = "$Id: res_debug.c,v 8.38 2001/02/13 23:12:56 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -452,6 +452,10 @@ const struct res_sym __p_type_syms[] = {
{ns_t_naptr, "NAPTR", "URN Naming Authority"},
{ns_t_kx, "KX", "Key Exchange"},
{ns_t_cert, "CERT", "Certificate"},
+ {ns_t_a6, "A6", "IPv6 Address"},
+ {ns_t_dname, "DNAME", "dname"},
+ {ns_t_sink, "SINK", "Kitchen Sink (experimental)"},
+ {ns_t_opt, "OPT", "EDNS Options"},
{ns_t_any, "ANY", "\"any\""},
{0, NULL, NULL}
};
diff --git a/contrib/bind/lib/resolv/res_init.c b/contrib/bind/lib/resolv/res_init.c
index 3ea9f02..8c63351 100644
--- a/contrib/bind/lib/resolv/res_init.c
+++ b/contrib/bind/lib/resolv/res_init.c
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 8.17 2000/11/08 06:47:37 marka Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 8.19 2001/03/08 03:57:16 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -179,6 +179,9 @@ __res_vinit(res_state statp, int preinit) {
statp->qhook = NULL;
statp->rhook = NULL;
statp->_u._ext.nscount = 0;
+#ifdef RESOLVSORT
+ statp->nsort = 0;
+#endif
/* Allow user to override the local domain definition */
if ((cp = getenv("LOCALDOMAIN")) != NULL) {
@@ -343,7 +346,8 @@ __res_vinit(res_state statp, int preinit) {
continue;
}
}
- if (nserv > 1)
+
+ if (nserv > 1)
statp->nscount = nserv;
#ifdef RESOLVSORT
statp->nsort = nsort;
@@ -507,5 +511,4 @@ res_nclose(res_state statp) {
statp->_u._ext.nssocks[ns] = -1;
}
}
- statp->_u._ext.nscount = 0;
}
diff --git a/contrib/bind/lib/resolv/res_send.c b/contrib/bind/lib/resolv/res_send.c
index 462d65d..ade9eac 100644
--- a/contrib/bind/lib/resolv/res_send.c
+++ b/contrib/bind/lib/resolv/res_send.c
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_send.c,v 8.41 2000/12/23 08:14:58 vixie Exp $";
+static const char rcsid[] = "$Id: res_send.c,v 8.42 2001/03/07 06:48:03 marka Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -307,15 +307,19 @@ res_nsend(res_state statp,
struct sockaddr_in ina;
int lastns = statp->nscount - 1;
int fd;
+ u_int16_t nstime;
ina = statp->nsaddr_list[0];
fd = EXT(statp).nssocks[0];
+ nstime = EXT(statp).nstimes[ns];
for (ns = 0; ns < lastns; ns++) {
statp->nsaddr_list[ns] = statp->nsaddr_list[ns + 1];
EXT(statp).nssocks[ns] = EXT(statp).nssocks[ns + 1];
+ EXT(statp).nstimes[ns] = EXT(statp).nstimes[ns + 1];
}
statp->nsaddr_list[lastns] = ina;
EXT(statp).nssocks[lastns] = fd;
+ EXT(statp).nstimes[lastns] = nstime;
}
/*
diff --git a/contrib/bind/lib/resolv/res_update.c b/contrib/bind/lib/resolv/res_update.c
index 685e467..1434d5c 100644
--- a/contrib/bind/lib/resolv/res_update.c
+++ b/contrib/bind/lib/resolv/res_update.c
@@ -1,5 +1,5 @@
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_update.c,v 1.25 2000/11/22 01:20:47 marka Exp $";
+static const char rcsid[] = "$Id: res_update.c,v 1.26 2001/03/05 04:03:00 marka Exp $";
#endif /* not lint */
/*
@@ -101,7 +101,8 @@ res_nupdate(res_state statp, ns_updrec *rrecp_in, ns_tsig_key *key) {
/* Thread all of the updates onto a list of groups. */
INIT_LIST(zgrps);
- for (rrecp = rrecp_in; rrecp; rrecp = NEXT(rrecp, r_link)) {
+ for (rrecp = rrecp_in; rrecp;
+ rrecp = LINKED(rrecp, r_link) ? NEXT(rrecp, r_link) : NULL) {
/* Find the origin for it if there is one. */
tgrp.z_class = rrecp->r_class;
tgrp.z_nscount =
OpenPOWER on IntegriCloud