mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
sync multiple changes from BIND 8.
This commit is contained in:
@@ -72,6 +72,7 @@ typedef struct log_channel *log_channel;
|
||||
#define log_dec_references __log_dec_references
|
||||
#define log_get_channel_type __log_get_channel_type
|
||||
#define log_free_channel __log_free_channel
|
||||
#define log_close_debug_channels __log_close_debug_channels
|
||||
|
||||
FILE * log_open_stream(log_channel);
|
||||
int log_close_stream(log_channel);
|
||||
@@ -98,5 +99,6 @@ int log_inc_references(log_channel);
|
||||
int log_dec_references(log_channel);
|
||||
log_channel_type log_get_channel_type(log_channel);
|
||||
int log_free_channel(log_channel);
|
||||
void log_close_debug_channels(log_context);
|
||||
|
||||
#endif /* !LOGGING_H */
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#endif /*MEMCLUSTER_RECORD*/
|
||||
#endif /*MEMCLUSTER_DEBUG*/
|
||||
#define memstats __memstats
|
||||
#define memactive __memactive
|
||||
|
||||
int meminit(size_t, size_t);
|
||||
void * __memget(size_t);
|
||||
@@ -43,5 +44,6 @@ void __memput_debug(void *, size_t, const char *, int);
|
||||
void * __memget_record(size_t, const char *, int);
|
||||
void __memput_record(void *, size_t, const char *, int);
|
||||
void memstats(FILE *);
|
||||
int memactive(void);
|
||||
|
||||
#endif /* MEMCLUSTER_H */
|
||||
|
@@ -50,7 +50,7 @@
|
||||
|
||||
/*
|
||||
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
|
||||
* $Id: resolv.h,v 1.4 2001/05/22 22:51:31 marka Exp $
|
||||
* $Id: resolv.h,v 1.5 2001/05/28 08:38:20 marka Exp $
|
||||
*/
|
||||
|
||||
#ifndef _RESOLV_H_
|
||||
@@ -98,7 +98,9 @@
|
||||
|
||||
#define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
|
||||
struct __res_state; /* forward */
|
||||
__BEGIN_DECLS
|
||||
void __h_errno_set(struct __res_state *res, int err);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Resolver configuration file.
|
||||
@@ -250,7 +252,9 @@ typedef struct __res_state *res_state;
|
||||
|
||||
/* Things involving an internal (static) resolver context. */
|
||||
#ifdef _REENTRANT
|
||||
__BEGIN_DECLS
|
||||
extern struct __res_state *__res_state(void);
|
||||
__END_DECLS
|
||||
#define _res (*__res_state())
|
||||
#else
|
||||
#ifndef __BIND_NOSTATIC
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char rcsid[] = "$Id: nsap_addr.c,v 1.1 2001/03/29 06:31:41 marka Exp $";
|
||||
static const char rcsid[] = "$Id: nsap_addr.c,v 1.2 2001/05/28 08:38:24 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
@@ -44,6 +44,10 @@ 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);
|
||||
ascii += 2;
|
||||
|
||||
while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
|
||||
if (c == '.' || c == '+' || c == '/')
|
||||
continue;
|
||||
@@ -75,7 +79,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 +89,9 @@ inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
|
||||
start = tmpbuf;
|
||||
}
|
||||
|
||||
*ascii++ = '0';
|
||||
*ascii++ = 'x';
|
||||
|
||||
if (binlen > 255)
|
||||
binlen = 255;
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char rcsid[] = "$Id: getgrent_r.c,v 1.3 2001/04/05 06:19:32 marka Exp $";
|
||||
static const char rcsid[] = "$Id: getgrent_r.c,v 1.4 2001/05/28 08:38:25 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <port_before.h>
|
||||
@@ -59,7 +59,7 @@ getgrnam_r(const char *name, struct group *gptr,
|
||||
|
||||
if (ge == NULL) {
|
||||
*result = NULL;
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
res = copy_group(ge, gptr, buf, buflen);
|
||||
@@ -96,7 +96,7 @@ getgrgid_r(gid_t gid, struct group *gptr,
|
||||
|
||||
if (ge == NULL) {
|
||||
*result = NULL;
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
res = copy_group(ge, gptr, buf, buflen);
|
||||
@@ -190,7 +190,7 @@ copy_group(struct group *ge, struct group *gptr, char *buf, int buflen) {
|
||||
|
||||
if (len > buflen) {
|
||||
errno = ERANGE;
|
||||
return (-1);
|
||||
return (ERANGE);
|
||||
}
|
||||
|
||||
/* copy group id */
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char rcsid[] = "$Id: getpwent_r.c,v 1.2 2001/04/09 04:53:22 marka Exp $";
|
||||
static const char rcsid[] = "$Id: getpwent_r.c,v 1.3 2001/05/28 08:38:26 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <port_before.h>
|
||||
@@ -58,7 +58,7 @@ getpwnam_r(const char *login, struct passwd *pwptr,
|
||||
|
||||
if (pw == NULL) {
|
||||
*result = NULL;
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
res = copy_passwd(pw, pwptr, buf, buflen);
|
||||
@@ -95,7 +95,7 @@ getpwuid_r(uid_t uid, struct passwd *pwptr,
|
||||
|
||||
if (pw == NULL) {
|
||||
*result = NULL;
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
res = copy_passwd(pw, pwptr, buf, buflen);
|
||||
@@ -210,7 +210,7 @@ copy_passwd(struct passwd *pw, struct passwd *pwptr, char *buf, int buflen) {
|
||||
|
||||
if (len > buflen) {
|
||||
errno = ERANGE;
|
||||
return (-1);
|
||||
return (ERANGE);
|
||||
}
|
||||
|
||||
/* copy fixed atomic values*/
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#if !defined(LINT) && !defined(CODECENTER)
|
||||
static const char rcsid[] = "$Id: logging.c,v 1.1 2001/03/29 06:31:55 marka Exp $";
|
||||
static const char rcsid[] = "$Id: logging.c,v 1.2 2001/05/28 08:38:28 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
@@ -178,6 +178,19 @@ log_close_stream(log_channel chan) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
log_close_debug_channels(log_context lc) {
|
||||
log_channel_list lcl;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < lc->num_categories; i++)
|
||||
for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl->next)
|
||||
if (lcl->channel->type == log_file &&
|
||||
lcl->channel->out.file.stream != NULL &&
|
||||
lcl->channel->flags & LOG_REQUIRE_DEBUG)
|
||||
(void)log_close_stream(lcl->channel);
|
||||
}
|
||||
|
||||
FILE *
|
||||
log_get_stream(log_channel chan) {
|
||||
if (chan == NULL || chan->type != log_file) {
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
#if !defined(LINT) && !defined(CODECENTER)
|
||||
static const char rcsid[] = "$Id: memcluster.c,v 1.1 2001/03/29 06:31:55 marka Exp $";
|
||||
static const char rcsid[] = "$Id: memcluster.c,v 1.2 2001/05/28 08:38:29 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
@@ -339,8 +339,9 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
|
||||
size_t new_size = quantize(size);
|
||||
#if defined (DEBUGGING_MEMCLUSTER)
|
||||
memcluster_element *e;
|
||||
memcluster_element *el;
|
||||
#ifdef MEMCLUSTER_RECORD
|
||||
memcluster_element *prev, *el;
|
||||
memcluster_element *prev;
|
||||
#endif
|
||||
int fp;
|
||||
char *p;
|
||||
@@ -493,6 +494,18 @@ memstats(FILE *out) {
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
memactive(void) {
|
||||
size_t i;
|
||||
|
||||
if (stats == NULL)
|
||||
return (0);
|
||||
for (i = 1; i <= max_size; i++)
|
||||
if (stats[i].gets != 0)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Private. */
|
||||
|
||||
/*
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id: ns_print.c,v 1.1 2001/03/29 06:31:57 marka Exp $";
|
||||
static const char rcsid[] = "$Id: ns_print.c,v 1.2 2001/05/28 08:38:30 marka Exp $";
|
||||
#endif
|
||||
|
||||
/* Import. */
|
||||
@@ -317,7 +317,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));
|
||||
|
@@ -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 1.5 2001/05/28 06:36:15 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_init.c,v 1.6 2001/05/28 08:38:32 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
@@ -382,7 +382,8 @@ __res_vinit(res_state statp, int preinit) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (nserv > 1)
|
||||
|
||||
if (nserv > 1)
|
||||
statp->nscount = nserv;
|
||||
#ifdef RESOLVSORT
|
||||
statp->nsort = nsort;
|
||||
|
Reference in New Issue
Block a user