2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

162 Commits

Author SHA1 Message Date
David Lawrence
40f53fa8d9 Trailing whitespace trimmed. Perhaps running "perl util/spacewhack.pl in your
own CVS tree will help minimize CVS conflicts.  Maybe not.
Blame Graff for getting me to trim all trailing whitespace.
2000-08-01 01:33:37 +00:00
Brian Wellington
4eabcbb83b In several places, the resolver assigned values to event->ev_sender simply
because the field couldn't be NULL (until recently).  They now use NULL.
2000-07-29 01:18:36 +00:00
Brian Wellington
cd54303345 357. [bug] The server would crash if a response contained both
a CNAME and records of the query type.
2000-07-28 22:37:47 +00:00
Brian Wellington
47846b7468 A comment was reformatted badly. 2000-07-27 22:05:04 +00:00
Brian Wellington
fbde30645b cd queries would cause the server to hang on exit. 2000-07-27 21:29:58 +00:00
Brian Wellington
f15af68028 negative responses to cd queries should work now. 2000-07-27 18:42:08 +00:00
David Lawrence
15a4474541 word wrap copyright notice at column 70 2000-07-27 09:55:03 +00:00
Brian Wellington
53dc771403 The CD bit changes broke insecurity proofs. They work again. 2000-07-26 00:03:18 +00:00
Brian Wellington
94ec6e9a1a whitespace fixes 2000-07-25 22:04:33 +00:00
Brian Wellington
69a761838b Support for the cd (checking disabled) bit. Also remove data from the
cache if validation fails.
2000-07-25 22:03:25 +00:00
Andreas Gustafsson
56f8b1c404 the "done" variable reintroduced in the previous revision
was not initialized
2000-07-24 23:55:19 +00:00
Andreas Gustafsson
6f12e3ca45 Restored the "done" variable removed in 1.150 and made
the result code check after the loop deal with ISC_R_SUCCESS
instead.  The previous fix had the side effect of keeping multiple
answers to non-ANY queries, causing assertion failures in cache_name()
which is not prepared to deal with this situation
2000-07-24 20:10:26 +00:00
Andreas Gustafsson
aa5940281a When handling the response to an ANY query in a secure zone, deal with
the multiple answer RRsets by validating each one separately.  Also,
eliminated the "done" variable in answer_response() because in the
rare situations where it got set to ISC_TRUE, it caused the function
to return prematurely by exiting a loop with a result of ISC_R_SUCCESS
and hitting a "if (result != ISC_R_NOMORE) return (result);" test
immediately following following the loop.

This should fix [RT #109], "ANY query in secure zone crashes server".
2000-07-19 23:19:05 +00:00
Andreas Gustafsson
0e65062acb strengthened the check added in the previous change:
the new query domain must not only be a non-child of the query name,
it must be a parent of the query name (or equal to the query name)
2000-07-16 18:26:18 +00:00
Andreas Gustafsson
64024eaa4d 333. [bug] The resolver incorrectly accepted referrals to
subdomains of the query domain, causing an
                        assertion failure.
2000-07-15 01:02:25 +00:00
Andreas Gustafsson
10f4e9668a the INSIST condition of 1.145 was too strong, weakened it;
dded another INSIST to help track down the INSIST(!external) crash
2000-07-14 00:37:27 +00:00
Andreas Gustafsson
55da37e18f removed dead code 2000-07-14 00:33:09 +00:00
Brian Wellington
ecb2897c71 Insist that when a fetch returns a successful event, the rdataset is associated.
A test failed about a week ago because this was not true, and because it
died in the event handler, diagnosing the problem was impossible.
2000-07-12 23:56:06 +00:00
David Lawrence
d20d22616b A socket result of ISC_R_SUCCESS can still possibly be posted even after
isc_socket_cancel() has been called.  resquery_senddone() has been fixed
to account for this (there was a race condition because of the faulty
assumption that only ISC_R_CANCELED would be returned after
isc_socket_cancel()).

The interaction of resquery_response() with the dispatcher now has to be
closely reviewed to make sure it does not have a similar problem with
a canceled query.  If the faulty assumption hadn't been faulty, it was
fine, but now I'm not so sure.
2000-07-07 19:43:14 +00:00
Brian Wellington
ca93ad9b9e If we're asking for a key and need to call dns_view_findzonecut(), set
the DNS_DB_NOEXACT flag.  This means that the resolver will start look for the
key at or above the parent zone, and will return the key set from the parent
zone if key sets are present in both the parent and child.
2000-07-06 02:33:43 +00:00
Michael Graff
8681403c16 Shut up a gcc warning 2000-07-05 20:26:46 +00:00
David Lawrence
96ab25294b 307. [bug] When canceling a query, the resolver didn't check for
isc_socket_sendto() calls that did not yet have their
			completion events posted, so it could (rarely) end up
			destroying the query context and then want to use
			it again when the send event posted, triggering an
			assertion as it tried to cancel an already-canceled
			query.  (RT #77)

... so now the resolver counts the number of outstanding isc_socket_sendto()s
and only destroys the query context when there are no more.
2000-07-04 01:19:20 +00:00
Michael Graff
0cd1ba32c1 put edns0 restarts back to 3, and fix up a few trace messages to be standard ones -- lower case first letter. 2000-06-28 16:30:29 +00:00
Michael Graff
7618ec31e3 bump restarts to 4. After 3, we change the retry times. This lets the query take longer, but it is more likely to succeed with EDNS0 if the server or the network is just slow, not broken. 2000-06-26 21:46:25 +00:00
Michael Graff
57ebb859ee After N restarts (currently 3) try again with EDNS0 disabled. 2000-06-26 21:07:36 +00:00
David Lawrence
9c3531d72a add RCS id string 2000-06-22 22:00:42 +00:00
Andreas Gustafsson
7bb1e299e1 269. [bug] Failed DNSSEC validations could cause an assertion
failure by causing clone_results() to be called with
                        with hevent->node == NULL.
2000-06-21 22:47:38 +00:00
Mark Andrews
3c671ac666 264. [func] Dispatch can not take TCP sockets in connecting
state.  Set DNS_DISPATCHATTR_CONNECTED when calling
                        dns_dispatch_createtcp() for connected TCP sockets
                        or call dns_dispatch_starttcp() when the socket is
                        connected.
2000-06-20 23:52:54 +00:00
Andreas Gustafsson
8bbc3795bf RT #133: fixed two separate bugs, each of which would cause a bus
error during shutdown of a busy caching server (specifically, one
making many outgoing TCP connections).

Bug 1: resquery_destroy() accessed query->fctx->res->mctx, even though
query->fctx could already be destroyed at this point.

Bug 2: resquery_connected() called fctx_done(query->fctx, result)
immediately after fctx_cancelquery(), which could destroy *query.

Also added some explanatory comments.
2000-06-16 01:16:39 +00:00
Andreas Gustafsson
9c11326b18 237. [bug] If connect() returned ENOBUFS when the resolver was
initiating a TCP query, the socket didn't get destroyed,
                        and the server did not shut down cleanly.  [RT #107]
2000-06-05 22:31:54 +00:00
David Lawrence
0b056755b2 225. [cleanup] The enumerated dns_rdatatype_* identifiers are now
cast to dns_rdatatype_t via macros of their same name
                        so that they are of the proper integral type wherever
                        a dns_rdatatype_t is needed.

(And a few prototypes that I recently bogusly changed to take "int" parameters
in place of "dns_rdatatype_t" to accomodate the type of an enum identifier
have been reverted to again properly take a dns_rdatatype_t.)
2000-06-01 21:42:42 +00:00
David Lawrence
6d12fdf966 Megacommit of many files.
Mostly, several functions that take pointers as arguments, almost
always char * pointers, had those pointers qualified with "const".
Those that returned pointers to previously const-qualified arguments
had their return values qualified as const.  Some structure members
were qualified as const to retain that attribute from the variables
from which they were assigned.

The macro DE_CONST is used to deal with a handful of very special
places where something is qualified as const but really needs to have
its const qualifier removed.

rdata.c now defines macros for the prototypes of the basic rdata functions,
and all of the lib/dns/rdata/**/*.c files now use them.

Some minor integer-compatibility issues.  (IE, ~0x03 is a signed int,
so assigning it to an unsigned int should use a cast.  The type of an
enum member is int, so there are some conversion issues there, too.)

A pointers-to-function should not be cast to a pointer-to-object.

Variables should not be named for C reserved identifiers.

One or two set-but-not-used variables removed.

Minor other ISC style cleanups.
2000-06-01 18:26:56 +00:00
Michael Graff
d98c74e2ec set the default destination port in the view, and use it when returning addresses from the adb. 2000-06-01 00:30:58 +00:00
Brian Wellington
91268e69b0 Don't directly access the TSIG field of the message. 2000-05-31 23:57:45 +00:00
Brian Wellington
75f6c57d95 When an rdataset is signed, its ttl is normalized based on the signature
validity period.
2000-05-31 22:01:39 +00:00
Brian Wellington
0f80bfec68 The message code now has functions to manipulate TSIG and SIG(0), and the
callers use these functions.  Also a lot of TSIG cleanup.
2000-05-30 23:14:57 +00:00
Andreas Gustafsson
7cd4c3ddd1 The 'cache-ttl' and 'ncache-ttl' options now work 2000-05-26 23:17:56 +00:00
Michael Graff
bd81a43c73 drop ::1.2.3.4 and ::ffff:1.2.3.4 in the resolver, not the adb. 2000-05-26 02:16:10 +00:00
Brian Wellington
af60263664 Added dns_tsigkey_attach & _detach, to simplify reference counting.
Added dns_message_get/settsigkey to deuglify tsig key handling in message code.
2000-05-26 00:16:46 +00:00
David Lawrence
ed019cabc1 fixed lines > 79 columns wide 2000-05-24 05:10:00 +00:00
Michael Graff
46993e1d9d Merge the mlg-20000518 branch onto the mainline. Change summary:
dns_dispatch_create() no longer exists.  dns_dispatch_createtcp()
	and dns_dispatch_getudp() are the replacements.  _createtcp() takes
	a bound, connected TCP socket, while _getudp() will search for
	a sharable UDP socket, and if found, attach to it and return a
	pointer to it.  If one is not found, it will create a udp socket,
	bind it to a supplied local address, and create a new dispatcher
	around it.

	dns_dispatch_remove{request,response}() no longer take the dispatch
	as an argument.

	query-source can now be set per view.

	The dispatch manager holds onto three memory pools, one for
	allocating dispatchers from, one for events, and one for
	requests/replies.  The free list on these pools is hard-coded,
	but set to 1024.  This keeps us from having to dig into the
	isc_mem_t the pools draw from as often.

	dns_resolver_create() and dns_view_createresolver() require that
	valid dispatchers be passed in; dispatchers are no longer created
	for the caller.
2000-05-19 21:46:46 +00:00
Andreas Gustafsson
64527927ac bind TCP socket to wildcard address; delay creation of
TCP dispatch until socket is connected
2000-05-17 20:33:29 +00:00
David Lawrence
57d32ef99d In fctx_query, if dns_dispatch_create fails jump to cleanup_query instead
of cleanup_dispatch; there is no query->dispatch to clean up.
2000-05-17 00:00:55 +00:00
Andreas Gustafsson
27fd91edc3 enabled previously #if 0'ed-out code to bind resolver sockets to
the wildcard address, as a temporary (?) fix for the server failing with
'socket is not bound' during startup
2000-05-15 05:09:13 +00:00
David Lawrence
971f454bbd Fixed these warnings:
"resolver.c", line 750: remark(1552): variable "trdataset" was set but never
          used
"resolver.c", line 3043: remark(1552): variable "have_sig" was set but never
          used

True and true.

"resolver.c", line 2194: warning(1551): variable "now" is used before its
          value is set

Moved setting of "now" to earlier in the function.
2000-05-14 02:27:26 +00:00
Michael Graff
ca9739800f implement dns_dispatchmgr_t, replacing dns_dispatchlist_t. Use it throughout the library/server. 2000-05-10 21:34:50 +00:00
David Lawrence
1a69a1a78c Megacommit of dozens of files.
Cleanup of redundant/useless header file inclusion.

ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
   /*
    * This is a comment.
    */
2000-05-08 14:38:29 +00:00
Andreas Gustafsson
bffbdf7545 cache all response RRs before validating 2000-05-05 17:26:47 +00:00
Andreas Gustafsson
62fb5eccb5 pass query type to negative response validator 2000-05-05 00:19:00 +00:00
Andreas Gustafsson
88b0c72919 validator support code checkpoint: cache negative validation results;
don't access freed ftcx when validation canceled
2000-05-04 16:38:09 +00:00