mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-12 14:29:28 +00:00
Fold in conflict related changes after beta26 merge.
Also, update the man pages - they were very old and out of date.
This commit is contained in:
parent
b497f11592
commit
820a9e2403
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11712
@ -67,7 +67,7 @@ OBJS+= version.o
|
|||||||
CLEANFILES+=version.c version.o
|
CLEANFILES+=version.c version.o
|
||||||
SUBDIR= tools xfer
|
SUBDIR= tools xfer
|
||||||
|
|
||||||
VER = LOCAL-`date +%y%m%d.%H%M%S`
|
VER = 4.9.3-BETA26-LOCAL
|
||||||
|
|
||||||
version.c: ${.CURDIR}/Version.c ${.CURDIR}/Makefile ${SRCS}
|
version.c: ${.CURDIR}/Version.c ${.CURDIR}/Makefile ${SRCS}
|
||||||
(LANG=; LC_TIME=; u=$${USER-root} d=`pwd |sed -e 's|/obj/|/src/|'` \
|
(LANG=; LC_TIME=; u=$${USER-root} d=`pwd |sed -e 's|/obj/|/src/|'` \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
static char sccsid[] = "@(#)db_glue.c 4.4 (Berkeley) 6/1/90";
|
static char sccsid[] = "@(#)db_glue.c 4.4 (Berkeley) 6/1/90";
|
||||||
static char rcsid[] = "$Id: db_glue.c,v 1.2 1995/05/30 03:48:39 rgrimes Exp $";
|
static char rcsid[] = "$Id: db_glue.c,v 1.3 1995/08/20 21:18:19 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1179,14 +1179,17 @@ ctimel(l)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This is nec'y for systems that croak when deref'ing unaligned pointers.
|
* This is nec'y for systems that croak when deref'ing unaligned pointers.
|
||||||
* SPARC is an example.
|
* SPARC is an example. Note that in_addr.s_addr needn't be a 32-bit int,
|
||||||
|
* so we want to avoid bcopy and let the compiler do the casting for us.
|
||||||
*/
|
*/
|
||||||
struct in_addr
|
struct in_addr
|
||||||
data_inaddr(data)
|
data_inaddr(data)
|
||||||
const u_char *data;
|
const u_char *data;
|
||||||
{
|
{
|
||||||
struct in_addr ret;
|
struct in_addr ret;
|
||||||
|
u_int32_t tmp;
|
||||||
|
|
||||||
bcopy((char *)data, (char *)&ret, INADDRSZ);
|
bcopy((char *)data, (char *)&tmp, INADDRSZ);
|
||||||
|
ret.s_addr = tmp;
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" @(#)named.8 6.6 (Berkeley) 2/14/89
|
.\" @(#)named.8 6.6 (Berkeley) 2/14/89
|
||||||
.\"
|
.\"
|
||||||
.TH NAMED 8 "April 17, 1993"
|
.TH NAMED 8 "June 20, 1995"
|
||||||
.UC 4
|
.UC 4
|
||||||
.SH NAME
|
.SH NAME
|
||||||
named \- Internet domain name server
|
named \- Internet domain name server
|
||||||
@ -64,7 +64,7 @@ named \- Internet domain name server
|
|||||||
.I debuglevel
|
.I debuglevel
|
||||||
] [
|
] [
|
||||||
.B \-p
|
.B \-p
|
||||||
.I port#
|
.IR port# [\fB/\fP\fIlocalport#\fP]
|
||||||
] [{\-b}
|
] [{\-b}
|
||||||
.I bootfile
|
.I bootfile
|
||||||
] [
|
] [
|
||||||
@ -90,8 +90,13 @@ A number after the ``d'' determines the level of
|
|||||||
messages printed.
|
messages printed.
|
||||||
.TP
|
.TP
|
||||||
.B \-p
|
.B \-p
|
||||||
Use a different port number. The default is the standard port number
|
Use nonstandard port numbers. The default is the standard port number
|
||||||
as returned by getservbyname(3) for service ``domain''.
|
as returned by getservbyname(3) for service ``domain''.
|
||||||
|
The argument can specify two port numbers separated by a slash (``\fB/\fP'')
|
||||||
|
in which case the first port is that used when contacting remote servers,
|
||||||
|
and the second one is the service port bound by the local instance of
|
||||||
|
.IR named .
|
||||||
|
This is used mostly for debugging purposes.
|
||||||
.TP
|
.TP
|
||||||
.B \-b
|
.B \-b
|
||||||
Use an alternate boot file. This is optional and allows you to
|
Use an alternate boot file. This is optional and allows you to
|
||||||
@ -99,11 +104,14 @@ specify a file with a leading dash.
|
|||||||
.TP
|
.TP
|
||||||
.B \-q
|
.B \-q
|
||||||
Trace all incoming queries if \fInamed\fP has been compiled with
|
Trace all incoming queries if \fInamed\fP has been compiled with
|
||||||
\fIQRYLOG\fP defined.
|
\fIQRYLOG\fP defined. \fINOTE:\fP this option is deprecated in favour
|
||||||
|
of the boot file directive ``options query-log''.
|
||||||
.TP
|
.TP
|
||||||
.B \-r
|
.B \-r
|
||||||
Turns recursion off in the server. Answers can come only from local
|
Turns recursion off in the server. Answers can come only from local
|
||||||
(primary or secondary) zones. This can be used on root servers.
|
(primary or secondary) zones. This can be used on root servers.
|
||||||
|
\fINOTE:\fP this option is deprecated in favour
|
||||||
|
of the boot file directive ``options no-recursion''.
|
||||||
.PP
|
.PP
|
||||||
Any additional argument is taken as the name of the boot file.
|
Any additional argument is taken as the name of the boot file.
|
||||||
If multiple boot files are specified, only the last is used.
|
If multiple boot files are specified, only the last is used.
|
||||||
@ -123,14 +131,16 @@ directory /usr/local/adm/named
|
|||||||
.ta \w'forwarders\ 'u +\w'6.32.128.IN-ADDR.ARPA\ 'u +\w'128.32.137.8 128.32.137.3\ 'u
|
.ta \w'forwarders\ 'u +\w'6.32.128.IN-ADDR.ARPA\ 'u +\w'128.32.137.8 128.32.137.3\ 'u
|
||||||
; type domain source host/file backup file
|
; type domain source host/file backup file
|
||||||
|
|
||||||
cache . named.root
|
cache . root.cache
|
||||||
primary Berkeley.EDU berkeley.edu.zone
|
primary Berkeley.EDU berkeley.edu.zone
|
||||||
primary 32.128.IN-ADDR.ARPA ucbhosts.rev
|
primary 32.128.IN-ADDR.ARPA ucbhosts.rev
|
||||||
secondary CC.Berkeley.EDU 128.32.137.8 128.32.137.3 cc.zone.bak
|
secondary CC.Berkeley.EDU 128.32.137.8 128.32.137.3 cc.zone.bak
|
||||||
secondary 6.32.128.IN-ADDR.ARPA 128.32.137.8 128.32.137.3 cc.rev.bak
|
secondary 6.32.128.IN-ADDR.ARPA 128.32.137.8 128.32.137.3 cc.rev.bak
|
||||||
primary 0.0.127.IN-ADDR.ARPA localhost.rev
|
primary 0.0.127.IN-ADDR.ARPA localhost.rev
|
||||||
forwarders 10.0.0.78 10.2.0.78
|
forwarders 10.0.0.78 10.2.0.78
|
||||||
; slave
|
limit max-xfers 10
|
||||||
|
limit datasize 64M
|
||||||
|
options forward-only query-log fake-iquery
|
||||||
|
|
||||||
.DT
|
.DT
|
||||||
.fi
|
.fi
|
||||||
@ -139,19 +149,19 @@ The ``directory'' line causes the server to change its working directory to
|
|||||||
the directory specified. This can be important for the correct processing
|
the directory specified. This can be important for the correct processing
|
||||||
of \s-1$INCLUDE\s+1 files in primary zone files.
|
of \s-1$INCLUDE\s+1 files in primary zone files.
|
||||||
.LP
|
.LP
|
||||||
The ``cache'' line specifies that data in ``named.root'' is to be placed in
|
The ``cache'' line specifies that data in ``root.cache'' is to be placed in
|
||||||
the backup cache. Its main use is to specify data such as locations of root
|
the backup cache. Its main use is to specify data such as locations of root
|
||||||
domain servers. This cache is not used during normal operation, but is used
|
domain servers. This cache is not used during normal operation, but is used
|
||||||
as ``hints'' to find the current root servers. The file ``named.root'' is
|
as ``hints'' to find the current root servers. The file ``root.cache'' is
|
||||||
in the same format as ``berkeley.edu.zone''. There can be more than one
|
in the same format as ``berkeley.edu.zone''. There can be more than one
|
||||||
``cache'' file specified. The ``named.root'' file should be retrieved
|
``cache'' file specified. The ``root.cache'' file should be retrieved
|
||||||
periodically from \s-1FTP.RS.INTERNIC.NET\s+1 since it contains a list of
|
periodically from \s-1FTP.RS.INTERNIC.NET\s+1 since it contains a list of
|
||||||
root servers, and this list changes periodically.
|
root servers, and this list changes periodically.
|
||||||
.LP
|
.LP
|
||||||
The first example ``primary'' line states that the file
|
The first example ``primary'' line states that the file
|
||||||
``berkeley.edu.zone'' contains authoritative data for the ``Berkeley.EDU''
|
``berkeley.edu.zone'' contains authoritative data for the ``Berkeley.EDU''
|
||||||
zone. The file ``berkeley.edu.zone'' contains data in the master file
|
zone. The file ``berkeley.edu.zone'' contains data in the master file
|
||||||
format described in RFC883. All domain names are relative to the origin, in
|
format described in RFC 883. All domain names are relative to the origin, in
|
||||||
this case, ``Berkeley.EDU'' (see below for a more detailed description).
|
this case, ``Berkeley.EDU'' (see below for a more detailed description).
|
||||||
The second ``primary'' line states that the file ``ucbhosts.rev'' contains
|
The second ``primary'' line states that the file ``ucbhosts.rev'' contains
|
||||||
authoritative data for the domain ``32.128.IN-ADDR.ARPA,'' which is used to
|
authoritative data for the domain ``32.128.IN-ADDR.ARPA,'' which is used to
|
||||||
@ -180,29 +190,26 @@ specifies one or more forwarders, then the server will send all queries for
|
|||||||
data not in the cache to the forwarders first. Each forwarder will be asked
|
data not in the cache to the forwarders first. Each forwarder will be asked
|
||||||
in turn until an answer is returned or the list is exhausted. If no answer
|
in turn until an answer is returned or the list is exhausted. If no answer
|
||||||
is forthcoming from a forwarder, the server will continue as it would have
|
is forthcoming from a forwarder, the server will continue as it would have
|
||||||
without the forwarders line unless it is in ``slave'' mode. The forwarding
|
without the forwarders line unless it is in ``forward-only'' mode. The
|
||||||
facility is useful to cause a large sitewide cache to be generated on a
|
forwarding facility is useful to cause a large sitewide cache to be
|
||||||
master, and to reduce traffic over links to outside servers. It can also be
|
generated on a master, and to reduce traffic over links to outside servers.
|
||||||
used to allow servers to run that do not have access directly to the
|
It can also be used to allow servers to run that do not have direct access
|
||||||
Internet, but wish to act as though they do.
|
to the Internet, but wish to look up exterior names anyway.
|
||||||
.LP
|
.LP
|
||||||
The ``slave'' line (shown commented out) is used to put the server in slave
|
The ``slave'' line (deprecated) is allowed for backward compatibility. Its
|
||||||
mode. In this mode, the server will only make queries to forwarders. This
|
meaning is identical to ``options forward-only''.
|
||||||
option is normally used on machine that wish to run a server but for
|
|
||||||
physical or administrative reasons cannot be given access to the Internet,
|
|
||||||
but have access to a host that does have access.
|
|
||||||
.LP
|
.LP
|
||||||
The ``sortlist'' line can be used to indicate networks that are to be
|
The ``sortlist'' line can be used to indicate networks that are to be
|
||||||
preferred over other networks Queries for host addresses from hosts on the
|
preferred over other networks. Queries for host addresses from hosts on the
|
||||||
same network as the server will receive responses with local network
|
same network as the server will receive responses with local network
|
||||||
addresses listed first, then addresses on the sort list, then other
|
addresses listed first, then addresses on the sort list, then other
|
||||||
addresses.
|
addresses.
|
||||||
.LP
|
.LP
|
||||||
The ``xfrnets'' directive (not shown) can be used to implement primative
|
The ``xfrnets'' directive (not shown) can be used to implement primitive
|
||||||
access control. If this directive is given, then your name server will
|
access control. If this directive is given, then your name server will
|
||||||
only answer zone transfer requests from hosts which are on networks listed
|
only answer zone transfer requests from hosts which are on networks listed
|
||||||
in your ``xfrnets'' directives. This directive may also be given as
|
in your ``xfrnets'' directives. This directive may also be given as
|
||||||
``tcplist'' for compatibility with older, interrim servers.
|
``tcplist'' for compatibility with older, interim servers.
|
||||||
.LP
|
.LP
|
||||||
The ``include'' directive (not shown) can be used to process the contents
|
The ``include'' directive (not shown) can be used to process the contents
|
||||||
of some other file as though they appeared in place of the ``include''
|
of some other file as though they appeared in place of the ``include''
|
||||||
@ -218,9 +225,38 @@ as dotted quads, not as domain names). This is useful when you know that
|
|||||||
some popular server has bad data in a zone or cache, and you want to avoid
|
some popular server has bad data in a zone or cache, and you want to avoid
|
||||||
contamination while the problem is being fixed.
|
contamination while the problem is being fixed.
|
||||||
.LP
|
.LP
|
||||||
The ``max-fetch'' directive (not shown) can be used to override the default
|
The ``limit'' directive can be used to change \s-1BIND\s+1's internal limits,
|
||||||
limit (which is 10) to the number of named-xfer subprocesses which \s-1BIND\s+1
|
some of which (\fBdatasize\fP, for example) are implemented by the system and
|
||||||
can spawn at any one time.
|
others (like \fBtransfers-in\fP) by \s-1BIND\s+1 itself. The number following
|
||||||
|
the limit name can be scaled by postfixing a ``k,'' ``m,'' or ``g'' for
|
||||||
|
kilobytes, megabytes, and gigabytes respectively.
|
||||||
|
\fBdatasize\fP's argument sets the process data size enforced by the kernel.
|
||||||
|
\fINote:\fP not all systems provide a call to implement this -- on such
|
||||||
|
systems, the use of the \fBdatasize\fP parameter of ``limit'' will result in
|
||||||
|
a warning message.
|
||||||
|
\fBtransfers-in\fP's argument is the number of \fInamed-xfer\fP subprocesses
|
||||||
|
which \s-1BIND\s+1 will spawn at any one time.
|
||||||
|
\fBtransfers-per-ns\fP's argument is the maximum number of zone transfers to
|
||||||
|
be simultaneously initiated to any given remote name server.
|
||||||
|
.LP
|
||||||
|
The ``options'' directive introduces a boolean specifier that changes the
|
||||||
|
behaviour of \s-1BIND\s+1. More than one option can be specified in a single
|
||||||
|
directive. The currently defined options are as follows:
|
||||||
|
\fBno-recursion\fP, which will cause \s-1BIND\s+1 to answer with a referral
|
||||||
|
rather than actual data whenever it receives a query for a name it is not
|
||||||
|
authoritative for -- don't set this on a server that is listed in any host's
|
||||||
|
\fIresolv.conf\fP file;
|
||||||
|
\fBquery-log\fP, which causes all queries to be logged via
|
||||||
|
syslog(8) -- this is a lot of data, don't turn it on lightly;
|
||||||
|
\fBforward-only\fP, which causes the server to query only its forwarders --
|
||||||
|
this option is normally used on machine that wishes to run a server but for
|
||||||
|
physical or administrative reasons cannot be given access to the Internet;
|
||||||
|
and \fBfake-iquery\fP, which tells \s-1BIND\s+1 to send back a useless and
|
||||||
|
bogus reply to ``inverse queries'' rather than responding with an error --
|
||||||
|
this is helpful if you have a lot of microcomputers or SunOS hosts or both.
|
||||||
|
.LP
|
||||||
|
The ``max-fetch'' directive (not shown) is allowed for backward compatibility;
|
||||||
|
its meaning is identical to ``limit transfers-in''.
|
||||||
.PP
|
.PP
|
||||||
The master file consists of control information and a list of resource
|
The master file consists of control information and a list of resource
|
||||||
records for objects in the zone of the forms:
|
records for objects in the zone of the forms:
|
||||||
@ -278,7 +314,7 @@ the canonical name for an alias (domain)
|
|||||||
.IP SOA
|
.IP SOA
|
||||||
marks the start of a zone of authority (domain of originating host,
|
marks the start of a zone of authority (domain of originating host,
|
||||||
domain address of maintainer, a serial number and the following
|
domain address of maintainer, a serial number and the following
|
||||||
parameters in seconds: refresh, retry, expire and minimum TTL (see RFC883)).
|
parameters in seconds: refresh, retry, expire and minimum TTL (see RFC 883)).
|
||||||
.IP NULL
|
.IP NULL
|
||||||
a null resource record (no format or data)
|
a null resource record (no format or data)
|
||||||
.IP RP
|
.IP RP
|
||||||
@ -337,15 +373,16 @@ server process using the
|
|||||||
.IR kill (1)
|
.IR kill (1)
|
||||||
command.
|
command.
|
||||||
.IP SIGHUP
|
.IP SIGHUP
|
||||||
Causes server to read named.boot and reload database. If the server
|
Causes server to read named.boot and reload the database. If the server
|
||||||
is built with the FORCED_RELOAD compile-time option, then SIGHUP will
|
is built with the FORCED_RELOAD compile-time option, then SIGHUP will
|
||||||
also cause the server to check the serial number on all secondary zones.
|
also cause the server to check the serial number on all secondary zones.
|
||||||
Normally the serial numbers are only checked at the SOA-specified intervals.
|
Normally the serial numbers are only checked at the SOA-specified intervals.
|
||||||
.IP SIGINT
|
.IP SIGINT
|
||||||
Dumps current data base and cache to /var/tmp/named_dump.db
|
Dumps the current data base and cache to /var/tmp/named_dump.db
|
||||||
.IP SIGIOT
|
.IP SIGIOT
|
||||||
Dumps statistics data into /var/tmp/named.stats if the server is
|
Dumps statistics data into /var/tmp/named.stats if the server is
|
||||||
compiled -DSTATS. Statistics data is appended to the file.
|
compiled with -DSTATS. Statistics data is appended to the file. Some
|
||||||
|
systems use SIGABRT rather than SIGIOT for this.
|
||||||
.IP SIGSYS
|
.IP SIGSYS
|
||||||
Dumps the profiling data in /var/tmp if the server is compiled
|
Dumps the profiling data in /var/tmp if the server is compiled
|
||||||
with profiling (server forks, chdirs and exits).
|
with profiling (server forks, chdirs and exits).
|
||||||
@ -360,7 +397,7 @@ Turns on debugging; each SIGUSR1 increments debug level.
|
|||||||
Turns off debugging completely.
|
Turns off debugging completely.
|
||||||
(SIGFPE on older systems without SIGUSR2)
|
(SIGFPE on older systems without SIGUSR2)
|
||||||
.IP SIGWINCH
|
.IP SIGWINCH
|
||||||
Toggles logging of all incoming queries via syslog(3)
|
Toggles logging of all incoming queries via syslog(8)
|
||||||
(requires server to have been built with the QRYLOG option).
|
(requires server to have been built with the QRYLOG option).
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.nf
|
.nf
|
||||||
@ -372,7 +409,7 @@ Toggles logging of all incoming queries via syslog(3)
|
|||||||
/var/tmp/named.stats nameserver statistics data
|
/var/tmp/named.stats nameserver statistics data
|
||||||
.fi
|
.fi
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
kill(1), gethostbyname(3), signal(3),
|
kill(1), gethostbyname(3), signal(2),
|
||||||
resolver(3), resolver(5), hostname(7),
|
resolver(3), resolver(5), hostname(7),
|
||||||
RFC 882, RFC 883, RFC 973, RFC 974, RFC 1033, RFC 1034, RFC 1035, RFC 1123,
|
RFC 882, RFC 883, RFC 973, RFC 974, RFC 1033, RFC 1034, RFC 1035, RFC 1123,
|
||||||
\fIName Server Operations Guide for \s-1BIND\s+1\fR
|
\fIName Server Operations Guide for \s-1BIND\s+1\fR
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
static char sccsid[] = "@(#)ns_forw.c 4.32 (Berkeley) 3/3/91";
|
static char sccsid[] = "@(#)ns_forw.c 4.32 (Berkeley) 3/3/91";
|
||||||
static char rcsid[] = "$Id: ns_forw.c,v 1.2 1995/05/30 03:48:49 rgrimes Exp $";
|
static char rcsid[] = "$Id: ns_forw.c,v 1.3 1995/08/20 21:18:36 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -374,6 +374,29 @@ nslookup(nsp, qp, syslogdname, sysloginfo)
|
|||||||
dname);
|
dname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#ifdef INADDR_LOOPBACK
|
||||||
|
if (ntohl(data_inaddr(dp->d_data).s_addr) ==
|
||||||
|
INADDR_LOOPBACK) {
|
||||||
|
syslog(LOG_INFO, "Bogus LOOPBACK A RR for %s",
|
||||||
|
dname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef INADDR_BROADCAST
|
||||||
|
if (ntohl(data_inaddr(dp->d_data).s_addr) ==
|
||||||
|
INADDR_BROADCAST) {
|
||||||
|
syslog(LOG_INFO, "Bogus BROADCAST A RR for %s",
|
||||||
|
dname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef IN_MULTICAST
|
||||||
|
if (IN_MULTICAST(ntohl(data_inaddr(dp->d_data).s_addr))) {
|
||||||
|
syslog(LOG_INFO, "Bogus MULTICAST A RR for %s",
|
||||||
|
dname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* Don't use records that may become invalid to
|
* Don't use records that may become invalid to
|
||||||
* reference later when we do the rtt computation.
|
* reference later when we do the rtt computation.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* from ns.h 4.33 (Berkeley) 8/23/90
|
* from ns.h 4.33 (Berkeley) 8/23/90
|
||||||
* $Id: ns_glob.h,v 1.2 1995/05/30 03:48:50 rgrimes Exp $
|
* $Id: ns_glob.h,v 1.3 1995/08/20 21:18:41 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -177,9 +177,6 @@ DECL u_int16_t ns_port;
|
|||||||
/* Source addr of last packet */
|
/* Source addr of last packet */
|
||||||
DECL struct sockaddr_in from_addr;
|
DECL struct sockaddr_in from_addr;
|
||||||
|
|
||||||
/* Source addr size of last packet */
|
|
||||||
DECL int from_len;
|
|
||||||
|
|
||||||
/* Used by ns_stats */
|
/* Used by ns_stats */
|
||||||
DECL time_t boottime,
|
DECL time_t boottime,
|
||||||
resettime;
|
resettime;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
static char sccsid[] = "@(#)ns_init.c 4.38 (Berkeley) 3/21/91";
|
static char sccsid[] = "@(#)ns_init.c 4.38 (Berkeley) 3/21/91";
|
||||||
static char rcsid[] = "$Id: ns_init.c,v 1.1.1.2 1995/08/18 21:16:00 peter Exp $";
|
static char rcsid[] = "$Id: ns_init.c,v 1.3 1995/08/20 21:18:44 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -65,7 +65,6 @@ static char rcsid[] = "$Id: ns_init.c,v 1.1.1.2 1995/08/18 21:16:00 peter Exp $"
|
|||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <signal.h>
|
|
||||||
#include <resolv.h>
|
#include <resolv.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -80,7 +79,7 @@ enum limit { Datasize };
|
|||||||
|
|
||||||
static void zoneinit __P((struct zoneinfo *)),
|
static void zoneinit __P((struct zoneinfo *)),
|
||||||
get_forwarders __P((FILE *)),
|
get_forwarders __P((FILE *)),
|
||||||
boot_read __P((char *)),
|
boot_read __P((const char *filename, int includefile)),
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
content_zone __P((int)),
|
content_zone __P((int)),
|
||||||
#endif
|
#endif
|
||||||
@ -175,7 +174,7 @@ ns_init(bootfile)
|
|||||||
content_zone(nzones - 1);
|
content_zone(nzones - 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
boot_read(bootfile);
|
boot_read(bootfile, 0);
|
||||||
|
|
||||||
/* erase all old zones that were not found */
|
/* erase all old zones that were not found */
|
||||||
for (zp = &zones[1]; zp < &zones[nzones]; zp++) {
|
for (zp = &zones[1]; zp < &zones[nzones]; zp++) {
|
||||||
@ -217,8 +216,9 @@ ns_init(bootfile)
|
|||||||
* Set up to recurse.
|
* Set up to recurse.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
boot_read(bootfile)
|
boot_read(filename, includefile)
|
||||||
char *bootfile;
|
const char *filename;
|
||||||
|
int includefile;
|
||||||
{
|
{
|
||||||
register struct zoneinfo *zp;
|
register struct zoneinfo *zp;
|
||||||
char buf[BUFSIZ], obuf[BUFSIZ], *source;
|
char buf[BUFSIZ], obuf[BUFSIZ], *source;
|
||||||
@ -236,8 +236,8 @@ boot_read(bootfile)
|
|||||||
int slineno; /* Saved global line number. */
|
int slineno; /* Saved global line number. */
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((fp = fopen(bootfile, "r")) == NULL) {
|
if ((fp = fopen(filename, "r")) == NULL) {
|
||||||
syslog(LOG_ERR, "%s: %m", bootfile);
|
syslog(LOG_ERR, "%s: %m", filename);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,11 +265,11 @@ boot_read(bootfile)
|
|||||||
get_netlist(fp, enettab, ALLOW_NETS, buf);
|
get_netlist(fp, enettab, ALLOW_NETS, buf);
|
||||||
continue;
|
continue;
|
||||||
} else if (strcasecmp(buf, "max-fetch") == 0) {
|
} else if (strcasecmp(buf, "max-fetch") == 0) {
|
||||||
max_xfers_running = getnum(fp, bootfile, GETNUM_NONE);
|
max_xfers_running = getnum(fp, filename, GETNUM_NONE);
|
||||||
continue;
|
continue;
|
||||||
} else if (strcasecmp(buf, "limit") == 0) {
|
} else if (strcasecmp(buf, "limit") == 0) {
|
||||||
(void) getword(buf, sizeof(buf), fp);
|
(void) getword(buf, sizeof(buf), fp);
|
||||||
ns_limit(buf, getnum(fp, bootfile, GETNUM_SCALED));
|
ns_limit(buf, getnum(fp, filename, GETNUM_SCALED));
|
||||||
continue;
|
continue;
|
||||||
} else if (strcasecmp(buf, "options") == 0) {
|
} else if (strcasecmp(buf, "options") == 0) {
|
||||||
while (getword(buf, sizeof(buf), fp))
|
while (getword(buf, sizeof(buf), fp))
|
||||||
@ -300,7 +300,7 @@ boot_read(bootfile)
|
|||||||
#endif
|
#endif
|
||||||
} else if (strcasecmp(buf, "include") == 0) {
|
} else if (strcasecmp(buf, "include") == 0) {
|
||||||
if (getword(buf, sizeof(buf), fp))
|
if (getword(buf, sizeof(buf), fp))
|
||||||
boot_read(buf);
|
boot_read(buf, 1);
|
||||||
continue;
|
continue;
|
||||||
} else if (strncasecmp(buf, "cache", 5) == 0) {
|
} else if (strncasecmp(buf, "cache", 5) == 0) {
|
||||||
type = Z_CACHE;
|
type = Z_CACHE;
|
||||||
@ -343,7 +343,7 @@ boot_read(bootfile)
|
|||||||
} else {
|
} else {
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"%s: line %d: unknown directive '%s'\n",
|
"%s: line %d: unknown directive '%s'\n",
|
||||||
bootfile, lineno, buf);
|
filename, lineno, buf);
|
||||||
endline(fp);
|
endline(fp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -353,14 +353,14 @@ boot_read(bootfile)
|
|||||||
*/
|
*/
|
||||||
if (!getword(obuf, sizeof(obuf), fp)) {
|
if (!getword(obuf, sizeof(obuf), fp)) {
|
||||||
syslog(LOG_NOTICE, "%s: line %d: missing origin\n",
|
syslog(LOG_NOTICE, "%s: line %d: missing origin\n",
|
||||||
bootfile, lineno);
|
filename, lineno);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
i = strlen(obuf);
|
i = strlen(obuf);
|
||||||
if ((obuf[i-1] == '.') && (i != 1))
|
if ((obuf[i-1] == '.') && (i != 1))
|
||||||
syslog(LOG_INFO,
|
syslog(LOG_INFO,
|
||||||
"%s: line %d: zone \"%s\" has trailing dot\n",
|
"%s: line %d: zone \"%s\" has trailing dot\n",
|
||||||
bootfile, lineno, obuf);
|
filename, lineno, obuf);
|
||||||
while ((--i >= 0) && (obuf[i] == '.'))
|
while ((--i >= 0) && (obuf[i] == '.'))
|
||||||
obuf[i] = '\0';
|
obuf[i] = '\0';
|
||||||
dprintf(1, (ddt, "zone origin %s", obuf[0]?obuf:"."));
|
dprintf(1, (ddt, "zone origin %s", obuf[0]?obuf:"."));
|
||||||
@ -369,7 +369,7 @@ boot_read(bootfile)
|
|||||||
*/
|
*/
|
||||||
if (!getword(buf, sizeof(buf), fp)) {
|
if (!getword(buf, sizeof(buf), fp)) {
|
||||||
syslog(LOG_NOTICE, "%s: line %d: missing %s\n",
|
syslog(LOG_NOTICE, "%s: line %d: missing %s\n",
|
||||||
bootfile, lineno,
|
filename, lineno,
|
||||||
#ifdef STUBS
|
#ifdef STUBS
|
||||||
(type == Z_SECONDARY || type == Z_STUB)
|
(type == Z_SECONDARY || type == Z_STUB)
|
||||||
#else
|
#else
|
||||||
@ -437,14 +437,14 @@ boot_read(bootfile)
|
|||||||
if (zp->z_refresh <= 0) {
|
if (zp->z_refresh <= 0) {
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"%s: line %d: bad refresh time '%s', ignored\n",
|
"%s: line %d: bad refresh time '%s', ignored\n",
|
||||||
bootfile, lineno, buf);
|
filename, lineno, buf);
|
||||||
zp->z_refresh = 0;
|
zp->z_refresh = 0;
|
||||||
} else if (cache_file == NULL)
|
} else if (cache_file == NULL)
|
||||||
cache_file = source;
|
cache_file = source;
|
||||||
#else
|
#else
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"%s: line %d: cache refresh ignored\n",
|
"%s: line %d: cache refresh ignored\n",
|
||||||
bootfile, lineno);
|
filename, lineno);
|
||||||
#endif
|
#endif
|
||||||
endline(fp);
|
endline(fp);
|
||||||
}
|
}
|
||||||
@ -495,7 +495,7 @@ boot_read(bootfile)
|
|||||||
else {
|
else {
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"%s: line %d: bad flag '%s'\n",
|
"%s: line %d: bad flag '%s'\n",
|
||||||
bootfile, lineno, flag);
|
filename, lineno, flag);
|
||||||
}
|
}
|
||||||
flag = cp;
|
flag = cp;
|
||||||
}
|
}
|
||||||
@ -571,7 +571,7 @@ boot_read(bootfile)
|
|||||||
* We will always transfer this zone again
|
* We will always transfer this zone again
|
||||||
* after a reload.
|
* after a reload.
|
||||||
*/
|
*/
|
||||||
sprintf(buf, "/%s/NsTmp%ld.%d", _PATH_TMPDIR,
|
sprintf(buf, "%s/NsTmp%ld.%d", _PATH_TMPDIR,
|
||||||
(long)getpid(), tmpnum++);
|
(long)getpid(), tmpnum++);
|
||||||
source = savestr(buf);
|
source = savestr(buf);
|
||||||
zp->z_flags |= Z_TMP_FILE;
|
zp->z_flags |= Z_TMP_FILE;
|
||||||
@ -930,8 +930,10 @@ ns_option(name)
|
|||||||
{
|
{
|
||||||
if (!strcasecmp(name, "no-recursion")) {
|
if (!strcasecmp(name, "no-recursion")) {
|
||||||
NoRecurse = 1;
|
NoRecurse = 1;
|
||||||
|
#ifdef QRYLOG
|
||||||
} else if (!strcasecmp(name, "query-log")) {
|
} else if (!strcasecmp(name, "query-log")) {
|
||||||
qrylog = 1;
|
qrylog = 1;
|
||||||
|
#endif
|
||||||
} else if (!strcasecmp(name, "forward-only")) {
|
} else if (!strcasecmp(name, "forward-only")) {
|
||||||
forward_only = 1;
|
forward_only = 1;
|
||||||
#ifndef INVQ
|
#ifndef INVQ
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
static char sccsid[] = "@(#)ns_main.c 4.55 (Berkeley) 7/1/91";
|
static char sccsid[] = "@(#)ns_main.c 4.55 (Berkeley) 7/1/91";
|
||||||
static char rcsid[] = "$Id: ns_main.c,v 1.2 1995/05/30 03:48:52 rgrimes Exp $";
|
static char rcsid[] = "$Id: ns_main.c,v 1.3 1995/08/20 21:18:46 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -169,8 +169,7 @@ main(argc, argv, envp)
|
|||||||
struct qstream *nextsp;
|
struct qstream *nextsp;
|
||||||
int nfds;
|
int nfds;
|
||||||
const int on = 1;
|
const int on = 1;
|
||||||
int len;
|
int rfd, size, len;
|
||||||
int rfd, size;
|
|
||||||
time_t lasttime, maxctime;
|
time_t lasttime, maxctime;
|
||||||
u_char buf[BUFSIZ];
|
u_char buf[BUFSIZ];
|
||||||
#ifdef POSIX_SIGNALS
|
#ifdef POSIX_SIGNALS
|
||||||
@ -179,6 +178,9 @@ main(argc, argv, envp)
|
|||||||
#ifndef SYSV
|
#ifndef SYSV
|
||||||
struct sigvec vec;
|
struct sigvec vec;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef NeXT
|
||||||
|
int old_sigmask;
|
||||||
#endif
|
#endif
|
||||||
fd_set tmpmask;
|
fd_set tmpmask;
|
||||||
struct timeval t, *tp;
|
struct timeval t, *tp;
|
||||||
@ -374,10 +376,10 @@ main(argc, argv, envp)
|
|||||||
}
|
}
|
||||||
#endif /*WANT_PIDFILE && PID_FIX*/
|
#endif /*WANT_PIDFILE && PID_FIX*/
|
||||||
exit(1);
|
exit(1);
|
||||||
} else { /* Retry opening the socket a few times */
|
|
||||||
my_close(vs);
|
|
||||||
sleep(1);
|
|
||||||
}
|
}
|
||||||
|
/* Retry opening the socket a few times */
|
||||||
|
my_close(vs);
|
||||||
|
sleep(3);
|
||||||
}
|
}
|
||||||
if (listen(vs, 5) != 0) {
|
if (listen(vs, 5) != 0) {
|
||||||
syslog(LOG_ERR, "listen(vs, 5): %m");
|
syslog(LOG_ERR, "listen(vs, 5): %m");
|
||||||
@ -385,7 +387,7 @@ main(argc, argv, envp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* named would be terminated if one of these is sent and no handler
|
* named would be terminated if one of these is sent and no handler.
|
||||||
*/
|
*/
|
||||||
(void) signal(SIGINT, setdumpflg);
|
(void) signal(SIGINT, setdumpflg);
|
||||||
(void) signal(SIGQUIT, setchkptflg);
|
(void) signal(SIGQUIT, setchkptflg);
|
||||||
@ -405,6 +407,8 @@ main(argc, argv, envp)
|
|||||||
/*
|
/*
|
||||||
* Get list of local addresses and set up datagram sockets.
|
* Get list of local addresses and set up datagram sockets.
|
||||||
*/
|
*/
|
||||||
|
FD_ZERO(&mask);
|
||||||
|
FD_SET(vs, &mask);
|
||||||
getnetconf();
|
getnetconf();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -572,10 +576,9 @@ main(argc, argv, envp)
|
|||||||
nfds = FD_SETSIZE; /* Bulletproofing */
|
nfds = FD_SETSIZE; /* Bulletproofing */
|
||||||
syslog(LOG_NOTICE, "Return from getdtablesize() > FD_SETSIZE");
|
syslog(LOG_NOTICE, "Return from getdtablesize() > FD_SETSIZE");
|
||||||
}
|
}
|
||||||
FD_ZERO(&mask);
|
#ifdef NeXT
|
||||||
FD_SET(vs, &mask);
|
old_sigmask = sigblock(sigmask(SIGCHLD));
|
||||||
for (dqp = datagramq; dqp != QDATAGRAM_NULL; dqp = dqp->dq_next)
|
#endif
|
||||||
FD_SET(dqp->dq_dfd, &mask);
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (ddt && debug == 0) {
|
if (ddt && debug == 0) {
|
||||||
@ -648,7 +651,13 @@ main(argc, argv, envp)
|
|||||||
} else
|
} else
|
||||||
tp = NULL;
|
tp = NULL;
|
||||||
tmpmask = mask;
|
tmpmask = mask;
|
||||||
|
#ifdef NeXT
|
||||||
|
sigsetmask(old_sigmask); /* Let queued signals run. */
|
||||||
|
#endif
|
||||||
n = select(nfds, &tmpmask, (fd_set *)NULL, (fd_set *)NULL, tp);
|
n = select(nfds, &tmpmask, (fd_set *)NULL, (fd_set *)NULL, tp);
|
||||||
|
#ifdef NeXT
|
||||||
|
old_sigmask = sigblock(sigmask(SIGCHLD));
|
||||||
|
#endif
|
||||||
if (n < 0 && errno != EINTR) {
|
if (n < 0 && errno != EINTR) {
|
||||||
syslog(LOG_ERR, "select: %m");
|
syslog(LOG_ERR, "select: %m");
|
||||||
sleep(60);
|
sleep(60);
|
||||||
@ -661,7 +670,8 @@ main(argc, argv, envp)
|
|||||||
dqp = dqp->dq_next) {
|
dqp = dqp->dq_next) {
|
||||||
if (FD_ISSET(dqp->dq_dfd, &tmpmask))
|
if (FD_ISSET(dqp->dq_dfd, &tmpmask))
|
||||||
for (udpcnt = 0; udpcnt < 42; udpcnt++) { /*XXX*/
|
for (udpcnt = 0; udpcnt < 42; udpcnt++) { /*XXX*/
|
||||||
from_len = sizeof(from_addr);
|
int from_len = sizeof(from_addr);
|
||||||
|
|
||||||
if ((n = recvfrom(dqp->dq_dfd, (char *)buf, sizeof(buf), 0,
|
if ((n = recvfrom(dqp->dq_dfd, (char *)buf, sizeof(buf), 0,
|
||||||
(struct sockaddr *)&from_addr, &from_len)) < 0)
|
(struct sockaddr *)&from_addr, &from_len)) < 0)
|
||||||
{
|
{
|
||||||
@ -702,7 +712,8 @@ main(argc, argv, envp)
|
|||||||
** which, if our accept() failed, will bring us back here.
|
** which, if our accept() failed, will bring us back here.
|
||||||
*/
|
*/
|
||||||
if (FD_ISSET(vs, &tmpmask)) {
|
if (FD_ISSET(vs, &tmpmask)) {
|
||||||
from_len = sizeof(from_addr);
|
int from_len = sizeof(from_addr);
|
||||||
|
|
||||||
rfd = accept(vs,
|
rfd = accept(vs,
|
||||||
(struct sockaddr *)&from_addr,
|
(struct sockaddr *)&from_addr,
|
||||||
&from_len);
|
&from_len);
|
||||||
@ -1173,7 +1184,7 @@ static void
|
|||||||
opensocket(dqp)
|
opensocket(dqp)
|
||||||
register struct qdatagram *dqp;
|
register struct qdatagram *dqp;
|
||||||
{
|
{
|
||||||
int n, m;
|
int m, n;
|
||||||
int on = 1;
|
int on = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1223,6 +1234,7 @@ opensocket(dqp)
|
|||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
FD_SET(dqp->dq_dfd, &mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1527,34 +1539,38 @@ sqflush(allbut)
|
|||||||
/* void
|
/* void
|
||||||
* dqflush(gen)
|
* dqflush(gen)
|
||||||
* close/deallocate all the udp sockets, unless `gen' != (time_t)0
|
* close/deallocate all the udp sockets, unless `gen' != (time_t)0
|
||||||
* in which case all those not matching this generation will
|
* in which case all those not from this generation (except 0.0.0.0)
|
||||||
* be deleted except the 0.0.0.0 element, and syslog() will
|
* will be deleted, and syslog() will be called.
|
||||||
* be called whenever something is deleted.
|
* known bugs:
|
||||||
|
* the above text is impenetrable.
|
||||||
* side effects:
|
* side effects:
|
||||||
* global list `datagramq' is modified
|
* global list `datagramq' is modified.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
dqflush(gen)
|
dqflush(gen)
|
||||||
register time_t gen;
|
register time_t gen;
|
||||||
{
|
{
|
||||||
register struct qdatagram *dqp, *pqp, *nqp;
|
register struct qdatagram *this, *prev, *next;
|
||||||
|
|
||||||
for (pqp = NULL, dqp = datagramq;
|
prev = NULL;
|
||||||
dqp != NULL;
|
for (this = datagramq; this != NULL; this = next) {
|
||||||
pqp = dqp, dqp = nqp) {
|
next = this->dq_next;
|
||||||
nqp = dqp->dq_next;
|
|
||||||
if (gen != (time_t)0) {
|
if (gen != (time_t)0) {
|
||||||
if (dqp->dq_addr.s_addr == INADDR_ANY ||
|
if (this->dq_addr.s_addr == INADDR_ANY ||
|
||||||
dqp->dq_gen == gen)
|
this->dq_gen == gen) {
|
||||||
|
prev = this;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
syslog(LOG_NOTICE, "interface [%s] missing; deleting",
|
syslog(LOG_NOTICE, "interface [%s] missing; deleting",
|
||||||
inet_ntoa(dqp->dq_addr));
|
inet_ntoa(this->dq_addr));
|
||||||
}
|
}
|
||||||
if (pqp != NULL)
|
FD_CLR(this->dq_dfd, &mask);
|
||||||
pqp->dq_next = dqp->dq_next;
|
my_close(this->dq_dfd);
|
||||||
|
free(this);
|
||||||
|
if (prev == NULL)
|
||||||
|
datagramq = next;
|
||||||
else
|
else
|
||||||
datagramq = dqp->dq_next;
|
prev->dq_next = next;
|
||||||
free(dqp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
static char sccsid[] = "@(#)ns_maint.c 4.39 (Berkeley) 3/2/91";
|
static char sccsid[] = "@(#)ns_maint.c 4.39 (Berkeley) 3/2/91";
|
||||||
static char rcsid[] = "$Id: ns_maint.c,v 1.2 1995/05/30 03:48:53 rgrimes Exp $";
|
static char rcsid[] = "$Id: ns_maint.c,v 1.3 1995/08/20 21:18:49 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -362,6 +362,9 @@ startxfer(zp)
|
|||||||
#ifdef GEN_AXFR
|
#ifdef GEN_AXFR
|
||||||
char class_str[10];
|
char class_str[10];
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef POSIX_SIGNALS
|
||||||
|
sigset_t sset;
|
||||||
|
#endif
|
||||||
|
|
||||||
dprintf(1, (ddt, "startxfer() %s\n", zp->z_origin));
|
dprintf(1, (ddt, "startxfer() %s\n", zp->z_origin));
|
||||||
|
|
||||||
@ -441,12 +444,22 @@ startxfer(zp)
|
|||||||
|
|
||||||
gettime(&tt);
|
gettime(&tt);
|
||||||
#ifndef SYSV
|
#ifndef SYSV
|
||||||
|
#if defined(POSIX_SIGNALS)
|
||||||
|
sigemptyset(&sset);
|
||||||
|
sigaddset(&sset,SIGCHLD);
|
||||||
|
sigprocmask(SIG_BLOCK,&sset,NULL);
|
||||||
|
#else
|
||||||
omask = sigblock(sigmask(SIGCHLD));
|
omask = sigblock(sigmask(SIGCHLD));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if ((pid = vfork()) == -1) {
|
if ((pid = vfork()) == -1) {
|
||||||
syslog(LOG_ERR, "xfer vfork: %m");
|
syslog(LOG_ERR, "xfer vfork: %m");
|
||||||
#ifndef SYSV
|
#ifndef SYSV
|
||||||
|
#if defined(POSIX_SIGNALS)
|
||||||
|
sigprocmask(SIG_UNBLOCK,&sset,NULL);
|
||||||
|
#else
|
||||||
(void) sigsetmask(omask);
|
(void) sigsetmask(omask);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
zp->z_time = tt.tv_sec + 10;
|
zp->z_time = tt.tv_sec + 10;
|
||||||
return;
|
return;
|
||||||
@ -466,8 +479,12 @@ startxfer(zp)
|
|||||||
xfers_running++;
|
xfers_running++;
|
||||||
zp->z_time = tt.tv_sec + MAX_XFER_TIME;
|
zp->z_time = tt.tv_sec + MAX_XFER_TIME;
|
||||||
#ifndef SYSV
|
#ifndef SYSV
|
||||||
|
#if defined(POSIX_SIGNALS)
|
||||||
|
sigprocmask(SIG_UNBLOCK,&sset,NULL);
|
||||||
|
#else
|
||||||
(void) sigsetmask(omask);
|
(void) sigsetmask(omask);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
static char sccsid[] = "@(#)ns_req.c 4.47 (Berkeley) 7/1/91";
|
static char sccsid[] = "@(#)ns_req.c 4.47 (Berkeley) 7/1/91";
|
||||||
static char rcsid[] = "$Id: ns_req.c,v 1.2 1995/05/30 03:48:55 rgrimes Exp $";
|
static char rcsid[] = "$Id: ns_req.c,v 1.3 1995/08/20 21:18:54 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -922,10 +922,32 @@ req_query(hp, cpp, eom, qsp, buflenp, msglenp, msg, dfd, from)
|
|||||||
*/
|
*/
|
||||||
delete_all(np, class, T_NS);
|
delete_all(np, class, T_NS);
|
||||||
#endif
|
#endif
|
||||||
|
for (dp = np->n_data; dp ; dp = dp->d_next)
|
||||||
|
if (dp->d_zone && match(dp, class, T_NS))
|
||||||
|
break;
|
||||||
|
if (dp) {
|
||||||
|
/*
|
||||||
|
* we know the child zone exists but are
|
||||||
|
* missing glue.
|
||||||
|
*
|
||||||
|
* nslookup has called sysquery() to get the
|
||||||
|
* missing glue.
|
||||||
|
*
|
||||||
|
* for UDP, drop the response and let the
|
||||||
|
* client retry. for TCP, we should probably
|
||||||
|
* (XXX) hold open the TCP connection for a
|
||||||
|
* while in case the sysquery() comes back
|
||||||
|
* soon. meanwhile we SERVFAIL.
|
||||||
|
*/
|
||||||
|
if (qsp)
|
||||||
|
goto do_servfail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
np = np->n_parent;
|
np = np->n_parent;
|
||||||
}
|
}
|
||||||
goto fetchns; /* Try again. */
|
goto fetchns; /* Try again. */
|
||||||
case FW_SERVFAIL:
|
case FW_SERVFAIL:
|
||||||
|
do_servfail:
|
||||||
hp->rcode = SERVFAIL;
|
hp->rcode = SERVFAIL;
|
||||||
#ifdef DATUMREFCNT
|
#ifdef DATUMREFCNT
|
||||||
free_nsp(nsp);
|
free_nsp(nsp);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
static char sccsid[] = "@(#)ns_resp.c 4.65 (Berkeley) 3/3/91";
|
static char sccsid[] = "@(#)ns_resp.c 4.65 (Berkeley) 3/3/91";
|
||||||
static char rcsid[] = "$Id: ns_resp.c,v 1.2 1995/05/30 03:48:56 rgrimes Exp $";
|
static char rcsid[] = "$Id: ns_resp.c,v 1.3 1995/08/20 21:18:58 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -270,10 +270,10 @@ ns_resp(msg, msglen)
|
|||||||
* Here we handle bad responses from servers.
|
* Here we handle bad responses from servers.
|
||||||
* Several possibilities come to mind:
|
* Several possibilities come to mind:
|
||||||
* The server is sick and returns SERVFAIL
|
* The server is sick and returns SERVFAIL
|
||||||
* The server returns some garbage opcode (its sick)
|
* The server returns some garbage opcode (it's sick)
|
||||||
* The server can't understand our query and return FORMERR
|
* The server can't understand our query and return FORMERR
|
||||||
* In all these cases, we simply drop the packet and force
|
* In all these cases, we drop the packet, disable retries on
|
||||||
* a retry. This will make him look bad due to unresponsiveness.
|
* this server and immediately force a retry.
|
||||||
*/
|
*/
|
||||||
if ((hp->rcode != NOERROR && hp->rcode != NXDOMAIN)
|
if ((hp->rcode != NOERROR && hp->rcode != NXDOMAIN)
|
||||||
#ifndef NCACHE
|
#ifndef NCACHE
|
||||||
@ -299,6 +299,19 @@ ns_resp(msg, msglen)
|
|||||||
nameserIncr(from_addr.sin_addr, nssRcvdErr);
|
nameserIncr(from_addr.sin_addr, nssRcvdErr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* mark server as bad */
|
||||||
|
if (!qp->q_fwd)
|
||||||
|
for (i = 0; i < (int)qp->q_naddr; i++)
|
||||||
|
if (qp->q_addr[i].ns_addr.sin_addr.s_addr
|
||||||
|
== from_addr.sin_addr.s_addr)
|
||||||
|
qp->q_addr[i].nretry = MAXRETRY;
|
||||||
|
/* XXX - doesn't handle responses sent from the wrong
|
||||||
|
* interface on a multihomed server
|
||||||
|
*/
|
||||||
|
if (qp->q_fwd ||
|
||||||
|
qp->q_addr[qp->q_curaddr].ns_addr.sin_addr.s_addr
|
||||||
|
== from_addr.sin_addr.s_addr)
|
||||||
|
retry(qp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,9 +370,15 @@ ns_resp(msg, msglen)
|
|||||||
|
|
||||||
if (type == T_NS && samedomain(qp->q_domain, name)) {
|
if (type == T_NS && samedomain(qp->q_domain, name)) {
|
||||||
nameserIncr(from_addr.sin_addr, nssRcvdLDel);
|
nameserIncr(from_addr.sin_addr, nssRcvdLDel);
|
||||||
|
/* mark server as bad */
|
||||||
|
if (!qp->q_fwd)
|
||||||
|
for (i = 0; i < (int)qp->q_naddr; i++)
|
||||||
|
if (qp->q_addr[i].ns_addr.sin_addr.s_addr
|
||||||
|
== from_addr.sin_addr.s_addr)
|
||||||
|
qp->q_addr[i].nretry = MAXRETRY;
|
||||||
#ifdef LAME_LOGGING
|
#ifdef LAME_LOGGING
|
||||||
if (class == C_IN &&
|
if (class == C_IN &&
|
||||||
!haveComplained((char*)nhash(name),
|
!haveComplained((char*)nhash(inet_etoa(&from_addr)),
|
||||||
(char*)nhash(qp->q_domain)))
|
(char*)nhash(qp->q_domain)))
|
||||||
syslog(LAME_LOGGING,
|
syslog(LAME_LOGGING,
|
||||||
"Lame server on '%s' (in '%s'?): %s%s\n",
|
"Lame server on '%s' (in '%s'?): %s%s\n",
|
||||||
@ -369,6 +388,13 @@ ns_resp(msg, msglen)
|
|||||||
);
|
);
|
||||||
|
|
||||||
#endif /* LAME_LOGGING */
|
#endif /* LAME_LOGGING */
|
||||||
|
/* XXX - doesn't handle responses sent from the wrong
|
||||||
|
* interface on a multihomed server
|
||||||
|
*/
|
||||||
|
if (qp->q_fwd ||
|
||||||
|
qp->q_addr[qp->q_curaddr].ns_addr.sin_addr.s_addr
|
||||||
|
== from_addr.sin_addr.s_addr)
|
||||||
|
retry(qp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1002,16 +1028,16 @@ ns_resp(msg, msglen)
|
|||||||
const char *result;
|
const char *result;
|
||||||
|
|
||||||
if (qp->q_addr[i].ns != NULL) {
|
if (qp->q_addr[i].ns != NULL) {
|
||||||
|
dprintf(1, (ddt, "ns_resp: ns %s rcnt %d (%s)\n",
|
||||||
|
qp->q_addr[i].ns->d_data,
|
||||||
|
qp->q_addr[i].ns->d_rcnt,
|
||||||
|
result));
|
||||||
if ((--(qp->q_addr[i].ns->d_rcnt)))
|
if ((--(qp->q_addr[i].ns->d_rcnt)))
|
||||||
result = busy;
|
result = busy;
|
||||||
else {
|
else {
|
||||||
free((char*)qp->q_addr[i].ns);
|
free((char*)qp->q_addr[i].ns);
|
||||||
result = freed;
|
result = freed;
|
||||||
}
|
}
|
||||||
dprintf(1, (ddt, "ns_resp: ns %s rcnt %d (%s)\n",
|
|
||||||
qp->q_addr[i].ns->d_data,
|
|
||||||
qp->q_addr[i].ns->d_rcnt,
|
|
||||||
result));
|
|
||||||
}
|
}
|
||||||
if (qp->q_addr[i].nsdata != NULL) {
|
if (qp->q_addr[i].nsdata != NULL) {
|
||||||
if ((--(qp->q_addr[i].nsdata->d_rcnt)))
|
if ((--(qp->q_addr[i].nsdata->d_rcnt)))
|
||||||
|
@ -51,10 +51,10 @@
|
|||||||
.\" -
|
.\" -
|
||||||
.\" --Copyright--
|
.\" --Copyright--
|
||||||
.\"
|
.\"
|
||||||
|
.\" $Id: named.restart.8,v 1.3 1995/05/03 03:26:56 rgrimes Exp $
|
||||||
.\" from hostname.7 6.4 (Berkeley) 1/16/90
|
.\" from hostname.7 6.4 (Berkeley) 1/16/90
|
||||||
.\" $Id$
|
|
||||||
.\"
|
.\"
|
||||||
.TH NAMED.RESTART 8 "May 2, 1995"
|
.TH NAMED.RESTART 8 "June 26, 1993"
|
||||||
.UC 5
|
.UC 5
|
||||||
.SH NAME
|
.SH NAME
|
||||||
named.restart \- stop and restart the name server
|
named.restart \- stop and restart the name server
|
||||||
|
@ -33,7 +33,7 @@ static char RCSid[] = "$Id:";
|
|||||||
#ifndef _PATH_XFER
|
#ifndef _PATH_XFER
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
# include "../conf/portability.h"
|
# include "portability.h"
|
||||||
#endif
|
#endif
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
|
|
||||||
|
@ -1,154 +0,0 @@
|
|||||||
.TH TREE 3 "5 April 1994"
|
|
||||||
.\" from .TH TREE 3 "22 Jan 1993"
|
|
||||||
.\" from .TH TREE 2 "23 June 1986"
|
|
||||||
.UC 4
|
|
||||||
.SH NAME
|
|
||||||
tree_init, tree_mung, tree_srch, tree_add, tree_delete, tree_trav
|
|
||||||
\- balanced binary tree routines
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.nf
|
|
||||||
.B void
|
|
||||||
.B tree_init(tree)
|
|
||||||
.B void **tree;
|
|
||||||
.PP
|
|
||||||
.B void *
|
|
||||||
.B tree_srch(tree, compare, data)
|
|
||||||
.B void **tree;
|
|
||||||
.B int (*compare)();
|
|
||||||
.B void *data;
|
|
||||||
.PP
|
|
||||||
.B void
|
|
||||||
.B tree_add(tree, compare, data, del_uar)
|
|
||||||
.B void **tree;
|
|
||||||
.B int (*compare)();
|
|
||||||
.B void *data;
|
|
||||||
.B void (*del_uar)();
|
|
||||||
.PP
|
|
||||||
.B int
|
|
||||||
.B tree_delete(tree, compare, data, del_uar)
|
|
||||||
.B void **tree;
|
|
||||||
.B int (*compare)();
|
|
||||||
.B void *data;
|
|
||||||
.B void (*del_uar)();
|
|
||||||
.PP
|
|
||||||
.B int
|
|
||||||
.B tree_trav(tree, trav_uar)
|
|
||||||
.B void **tree;
|
|
||||||
.B int (*trav_uar)();
|
|
||||||
.PP
|
|
||||||
.B void
|
|
||||||
.B tree_mung(tree, del_uar)
|
|
||||||
.B void **tree;
|
|
||||||
.B void (*del_uar)();
|
|
||||||
.fi
|
|
||||||
.SH DESCRIPTION
|
|
||||||
These functions create and manipulate a balanced binary (AVL) tree. Each node
|
|
||||||
of the tree contains the expected left & right subtree pointers, a short int
|
|
||||||
balance indicator, and a pointer to the user data. On a 32 bit system, this
|
|
||||||
means an overhead of 4+4+2+4 bytes per node (or, on a RISC or otherwise
|
|
||||||
alignment constrained system with implied padding, 4+4+4+4 bytes per node).
|
|
||||||
There is no key data type enforced by this package; a caller supplied
|
|
||||||
compare routine is used to compare user data blocks.
|
|
||||||
.PP
|
|
||||||
Balanced binary trees are very fast on searches and replacements, but have a
|
|
||||||
moderately high cost for additions and deletions. If your application does a
|
|
||||||
lot more searches and replacements than it does additions and deletions, the
|
|
||||||
balanced (AVL) binary tree is a good choice for a data structure.
|
|
||||||
.PP
|
|
||||||
.I Tree_init
|
|
||||||
creates an empty tree and binds it to
|
|
||||||
.I tree
|
|
||||||
(which for this and all other routines in this package should be declared as
|
|
||||||
a pointer to void or int, and passed by reference), which can then be used by
|
|
||||||
other routines in this package. Note that more than one
|
|
||||||
.I tree
|
|
||||||
variable can exist at once; thus multiple trees can be manipulated
|
|
||||||
simultaneously.
|
|
||||||
.PP
|
|
||||||
.I Tree_srch
|
|
||||||
searches a tree for a specific node and returns either
|
|
||||||
.I NULL
|
|
||||||
if no node was found, or the value of the user data pointer if the node
|
|
||||||
was found.
|
|
||||||
.I compare
|
|
||||||
is the address of a function to compare two user data blocks. This routine
|
|
||||||
should work much the way
|
|
||||||
.IR strcmp (3)
|
|
||||||
does; in fact,
|
|
||||||
.I strcmp
|
|
||||||
could be used if the user data was a \s-2NUL\s+2 terminated string.
|
|
||||||
.I data
|
|
||||||
is the address of a user data block to be used by
|
|
||||||
.I compare
|
|
||||||
as the search criteria. The tree is searched for a node where
|
|
||||||
.I compare
|
|
||||||
returns 0.
|
|
||||||
.PP
|
|
||||||
.I Tree_add
|
|
||||||
inserts or replaces a node in the specified tree. The tree specified by
|
|
||||||
.I tree
|
|
||||||
is searched as in
|
|
||||||
.I tree_srch,
|
|
||||||
and if a node is found to match
|
|
||||||
.I data,
|
|
||||||
then the
|
|
||||||
.I del_uar
|
|
||||||
function, if non\-\s-2NULL\s+2, is called with the address of the user data
|
|
||||||
block for the node (this routine should deallocate any dynamic memory which
|
|
||||||
is referenced exclusively by the node); the user data pointer for the node
|
|
||||||
is then replaced by the value of
|
|
||||||
.I data.
|
|
||||||
If no node is found to match, a new node is added (which may or may not
|
|
||||||
cause a transparent rebalance operation), with a user data pointer equal to
|
|
||||||
.I data.
|
|
||||||
A rebalance may or may not occur, depending on where the node is added
|
|
||||||
and what the rest of the tree looks like.
|
|
||||||
.I Tree_add
|
|
||||||
will return the
|
|
||||||
.I data
|
|
||||||
pointer unless catastrophe occurs in which case it will return \s-2NULL\s+2.
|
|
||||||
.PP
|
|
||||||
.I Tree_delete
|
|
||||||
deletes a node from
|
|
||||||
.I tree.
|
|
||||||
A rebalance may or may not occur, depending on where the node is removed from
|
|
||||||
and what the rest of the tree looks like.
|
|
||||||
.I Tree_delete
|
|
||||||
returns TRUE if a node was deleted, FALSE otherwise.
|
|
||||||
.PP
|
|
||||||
.I Tree_trav
|
|
||||||
traverses all of
|
|
||||||
.I tree,
|
|
||||||
calling
|
|
||||||
.I trav_uar
|
|
||||||
with the address of each user data block. If
|
|
||||||
.I trav_uar
|
|
||||||
returns FALSE at any time,
|
|
||||||
.I tree_trav
|
|
||||||
will immediately return FALSE to its caller. Otherwise all nodes will be
|
|
||||||
reached and
|
|
||||||
.I tree_trav
|
|
||||||
will return TRUE.
|
|
||||||
.PP
|
|
||||||
.I Tree_mung
|
|
||||||
deletes every node in
|
|
||||||
.I tree,
|
|
||||||
calling
|
|
||||||
.I del_uar
|
|
||||||
(if it is not \s-2NULL\s+2) with the user data address from each node (see
|
|
||||||
.I tree_add
|
|
||||||
and
|
|
||||||
.I tree_delete
|
|
||||||
above). The tree is left in the same state that
|
|
||||||
.I tree_init
|
|
||||||
leaves it in \- i.e., empty.
|
|
||||||
.SH BUGS
|
|
||||||
Should have a way for the caller to specify application specific
|
|
||||||
.I malloc
|
|
||||||
and
|
|
||||||
.I free
|
|
||||||
functions to be used internally when allocating meta data.
|
|
||||||
.SH AUTHOR
|
|
||||||
Paul Vixie, converted and augumented from Modula\-2 examples in
|
|
||||||
.I Algorithms & Data Structures,
|
|
||||||
Niklaus Wirth, Prentice\-Hall, ISBN 0\-13\-022005\-1.
|
|
@ -10,7 +10,7 @@ BINDIR= /usr/libexec
|
|||||||
MAN8= named-xfer.8
|
MAN8= named-xfer.8
|
||||||
|
|
||||||
|
|
||||||
VER = LOCAL-`date +%y%m%d.%H%M%S`
|
VER = 4.9.3-BETA26-LOCAL
|
||||||
|
|
||||||
version.c: ${.CURDIR}/../Version.c ${.CURDIR}/Makefile ${SRCS}
|
version.c: ${.CURDIR}/../Version.c ${.CURDIR}/Makefile ${SRCS}
|
||||||
(LANG=; LC_TIME=; u=$${USER-root} d=`pwd |sed -e 's|/obj/|/src/|'` \
|
(LANG=; LC_TIME=; u=$${USER-root} d=`pwd |sed -e 's|/obj/|/src/|'` \
|
||||||
|
Loading…
Reference in New Issue
Block a user