Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
c20ffa38
Commit
c20ffa38
authored
Apr 11, 2001
by
Brian Wellington
Browse files
808. [func] Add 'rndc flush' to flush the server's cache.
parent
9ffcab1e
Changes
13
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
c20ffa38
808. [func] Add 'rndc flush' to flush the server's cache.
807. [bug] When setting up TCP connections for incoming zone
transfers, the transfer-source port was not
ignored like it should be.
...
...
bin/named/control.c
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: control.c,v 1.
2
2001/04/1
0
2
1:50:40
bwelling Exp $ */
/* $Id: control.c,v 1.
3
2001/04/1
1
2
0:37:33
bwelling Exp $ */
#include
<config.h>
...
...
@@ -109,6 +109,8 @@ ns_control_docommand(isccc_sexpr_t *message) {
ns_g_debuglevel
=
0
;
isc_log_setdebuglevel
(
ns_g_lctx
,
ns_g_debuglevel
);
result
=
ISC_R_SUCCESS
;
}
else
if
(
command_compare
(
command
,
NS_COMMAND_FLUSH
))
{
result
=
ns_server_flushcache
(
ns_g_server
);
}
else
{
isc_log_write
(
ns_g_lctx
,
NS_LOGCATEGORY_GENERAL
,
NS_LOGMODULE_CONTROL
,
ISC_LOG_WARNING
,
...
...
bin/named/include/named/control.h
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: control.h,v 1.
2
2001/04/1
0
2
1:50:45
bwelling Exp $ */
/* $Id: control.h,v 1.
3
2001/04/1
1
2
0:37:36
bwelling Exp $ */
#ifndef NAMED_CONTROL_H
#define NAMED_CONTROL_H 1
...
...
@@ -37,6 +37,7 @@
#define NS_COMMAND_DUMPDB "dumpdb"
#define NS_COMMAND_TRACE "trace"
#define NS_COMMAND_NOTRACE "notrace"
#define NS_COMMAND_FLUSH "flush"
isc_result_t
ns_control_init
(
void
);
...
...
bin/named/include/named/server.h
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.h,v 1.5
2
2001/0
2
/1
4 03:50:08 gson
Exp $ */
/* $Id: server.h,v 1.5
3
2001/0
4
/1
1 20:37:37 bwelling
Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
...
...
@@ -148,4 +148,10 @@ ns_server_dumpdb(ns_server_t *server);
isc_result_t
ns_server_setdebuglevel
(
ns_server_t
*
server
,
char
*
args
);
/*
* Flush the server's cache(s)
*/
isc_result_t
ns_server_flushcache
(
ns_server_t
*
server
);
#endif
/* NAMED_SERVER_H */
bin/named/server.c
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.31
5
2001/0
3/29 04:25:59 gson
Exp $ */
/* $Id: server.c,v 1.31
6
2001/0
4/11 20:37:34 bwelling
Exp $ */
#include
<config.h>
...
...
@@ -2685,3 +2685,24 @@ ns_server_setdebuglevel(ns_server_t *server, char *args) {
isc_log_setdebuglevel
(
ns_g_lctx
,
ns_g_debuglevel
);
return
(
ISC_R_SUCCESS
);
}
isc_result_t
ns_server_flushcache
(
ns_server_t
*
server
)
{
dns_view_t
*
view
;
isc_result_t
result
;
result
=
isc_task_beginexclusive
(
server
->
task
);
RUNTIME_CHECK
(
result
==
ISC_R_SUCCESS
);
for
(
view
=
ISC_LIST_HEAD
(
server
->
viewlist
);
view
!=
NULL
;
view
=
ISC_LIST_NEXT
(
view
,
link
))
{
result
=
dns_view_flushcache
(
view
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
out
;
}
result
=
ISC_R_SUCCESS
;
out:
isc_task_endexclusive
(
server
->
task
);
return
(
result
);
}
bin/rndc/rndc.c
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc.c,v 1.5
2
2001/04/1
0
2
2:00:41
bwelling Exp $ */
/* $Id: rndc.c,v 1.5
3
2001/04/1
1
2
0:37:39
bwelling Exp $ */
/*
* Principal Author: DCL
...
...
@@ -110,6 +110,7 @@ command is one of the following:\n\
trace Increment debugging level by one.
\n
\
trace level Change the debugging level.
\n
\
notrace Set debugging level to 0.
\n
\
flush Flushes the server's cache.
\n
\
*status Display ps(1) status of named.
\n
\
*restart Restart the server.
\n
\
\n
\
...
...
lib/dns/adb.c
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: adb.c,v 1.17
3
2001/04/1
0 00:18:27 gson
Exp $ */
/* $Id: adb.c,v 1.17
4
2001/04/1
1 20:37:40 bwelling
Exp $ */
/*
* Implementation notes
...
...
@@ -4008,3 +4008,26 @@ dns_adb_freeaddrinfo(dns_adb_t *adb, dns_adbaddrinfo_t **addrp) {
UNLOCK
(
&
adb
->
lock
);
}
}
void
dns_adb_flush
(
dns_adb_t
*
adb
)
{
unsigned
int
i
;
INSIST
(
DNS_ADB_VALID
(
adb
));
LOCK
(
&
adb
->
lock
);
for
(
i
=
0
;
i
<
NBUCKETS
;
i
++
)
{
/*
* Call our cleanup routines.
*/
cleanup_names
(
adb
,
i
,
INT_MAX
);
cleanup_entries
(
adb
,
i
,
INT_MAX
);
}
#ifdef DUMP_ADB_AFTER_CLEANING
dump_adb
(
adb
,
stdout
,
ISC_TRUE
);
#endif
UNLOCK
(
&
adb
->
lock
);
}
lib/dns/cache.c
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cache.c,v 1.3
5
2001/0
3/08 01:22:48 tale
Exp $ */
/* $Id: cache.c,v 1.3
6
2001/0
4/11 20:37:42 bwelling
Exp $ */
#include
<config.h>
...
...
@@ -97,6 +97,9 @@ struct dns_cache {
dns_rdataclass_t
rdclass
;
dns_db_t
*
db
;
cache_cleaner_t
cleaner
;
char
*
db_type
;
int
db_argc
;
char
**
db_argv
;
/* Locked by 'filelock'. */
char
*
filename
;
...
...
@@ -124,6 +127,13 @@ cleaner_shutdown_action(isc_task_t *task, isc_event_t *event);
static
void
overmem_cleaning_action
(
isc_task_t
*
task
,
isc_event_t
*
event
);
static
inline
isc_result_t
cache_create_db
(
dns_cache_t
*
cache
,
dns_db_t
**
db
)
{
return
(
dns_db_create
(
cache
->
mctx
,
cache
->
db_type
,
dns_rootname
,
dns_dbtype_cache
,
cache
->
rdclass
,
cache
->
db_argc
,
cache
->
db_argv
,
db
));
}
isc_result_t
dns_cache_create
(
isc_mem_t
*
mctx
,
isc_taskmgr_t
*
taskmgr
,
isc_timermgr_t
*
timermgr
,
dns_rdataclass_t
rdclass
,
...
...
@@ -132,6 +142,7 @@ dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
{
isc_result_t
result
;
dns_cache_t
*
cache
;
int
i
;
REQUIRE
(
cachep
!=
NULL
);
REQUIRE
(
*
cachep
==
NULL
);
...
...
@@ -166,12 +177,37 @@ dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
cache
->
live_tasks
=
0
;
cache
->
rdclass
=
rdclass
;
cache
->
db_type
=
isc_mem_strdup
(
mctx
,
db_type
);
if
(
cache
->
db_type
==
NULL
)
{
result
=
ISC_R_NOMEMORY
;
goto
cleanup_filelock
;
}
cache
->
db_argc
=
db_argc
;
if
(
cache
->
db_argc
==
0
)
cache
->
db_argv
=
NULL
;
else
{
cache
->
db_argv
=
isc_mem_get
(
mctx
,
cache
->
db_argc
*
sizeof
(
char
*
));
if
(
cache
->
db_argv
==
NULL
)
{
result
=
ISC_R_NOMEMORY
;
goto
cleanup_dbtype
;
}
for
(
i
=
0
;
i
<
cache
->
db_argc
;
i
++
)
cache
->
db_argv
[
i
]
=
NULL
;
for
(
i
=
0
;
i
<
cache
->
db_argc
;
i
++
)
{
cache
->
db_argv
[
i
]
=
isc_mem_strdup
(
mctx
,
db_argv
[
i
]);
if
(
cache
->
db_argv
[
i
]
==
NULL
)
{
result
=
ISC_R_NOMEMORY
;
goto
cleanup_dbargv
;
}
}
}
cache
->
db
=
NULL
;
result
=
dns_db_create
(
cache
->
mctx
,
db_type
,
dns_rootname
,
dns_dbtype_cache
,
rdclass
,
db_argc
,
db_argv
,
&
cache
->
db
);
result
=
cache_create_db
(
cache
,
&
cache
->
db
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
cleanup_
filelock
;
goto
cleanup_
dbargv
;
cache
->
filename
=
NULL
;
...
...
@@ -187,6 +223,13 @@ dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
cleanup_db:
dns_db_detach
(
&
cache
->
db
);
cleanup_dbargv:
for
(
i
=
0
;
i
<
cache
->
db_argc
;
i
++
)
if
(
cache
->
db_argv
[
i
]
!=
NULL
)
isc_mem_free
(
mctx
,
cache
->
db_argv
[
i
]);
isc_mem_put
(
mctx
,
cache
->
db_argv
,
cache
->
db_argc
*
sizeof
(
char
*
));
cleanup_dbtype:
isc_mem_free
(
mctx
,
cache
->
db_type
);
cleanup_filelock:
DESTROYLOCK
(
&
cache
->
filelock
);
cleanup_lock:
...
...
@@ -200,6 +243,7 @@ dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
static
void
cache_free
(
dns_cache_t
*
cache
)
{
isc_mem_t
*
mctx
;
int
i
;
REQUIRE
(
VALID_CACHE
(
cache
));
REQUIRE
(
cache
->
references
==
0
);
...
...
@@ -223,9 +267,20 @@ cache_free(dns_cache_t *cache) {
cache
->
filename
=
NULL
;
}
if
(
cache
->
db
)
if
(
cache
->
db
!=
NULL
)
dns_db_detach
(
&
cache
->
db
);
if
(
cache
->
db_argv
!=
NULL
)
{
for
(
i
=
0
;
i
<
cache
->
db_argc
;
i
++
)
if
(
cache
->
db_argv
[
i
]
!=
NULL
)
isc_mem_free
(
cache
->
mctx
,
cache
->
db_argv
[
i
]);
isc_mem_put
(
cache
->
mctx
,
cache
->
db_argv
,
cache
->
db_argc
*
sizeof
(
char
*
));
}
if
(
cache
->
db_type
!=
NULL
)
isc_mem_free
(
cache
->
mctx
,
cache
->
db_type
);
DESTROYLOCK
(
&
cache
->
lock
);
DESTROYLOCK
(
&
cache
->
filelock
);
cache
->
magic
=
0
;
...
...
@@ -802,3 +857,17 @@ cleaner_shutdown_action(isc_task_t *task, isc_event_t *event) {
if
(
should_free
)
cache_free
(
cache
);
}
isc_result_t
dns_cache_flush
(
dns_cache_t
*
cache
)
{
dns_db_t
*
db
=
NULL
;
isc_result_t
result
;
result
=
cache_create_db
(
cache
,
&
db
);
if
(
result
!=
ISC_R_SUCCESS
)
return
(
result
);
dns_db_detach
(
&
cache
->
db
);
cache
->
db
=
db
;
return
(
ISC_R_SUCCESS
);
}
lib/dns/include/dns/adb.h
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: adb.h,v 1.6
4
2001/0
2/28
20:
4
7:
36 gson
Exp $ */
/* $Id: adb.h,v 1.6
5
2001/0
4/11
20:
3
7:
48 bwelling
Exp $ */
#ifndef DNS_ADB_H
#define DNS_ADB_H 1
...
...
@@ -559,6 +559,15 @@ dns_adb_freeaddrinfo(dns_adb_t *adb, dns_adbaddrinfo_t **addrp);
* *addrp is a valid dns_adbaddrinfo_t *.
*/
void
dns_adb_flush
(
dns_adb_t
*
adb
);
/*
* Flushes all cached data from the adb.
*
* Requires:
* adb is valid.
*/
ISC_LANG_ENDDECLS
#endif
/* DNS_ADB_H */
lib/dns/include/dns/cache.h
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cache.h,v 1.1
6
2001/0
1/09 21:52:1
9 bwelling Exp $ */
/* $Id: cache.h,v 1.1
7
2001/0
4/11 20:37:4
9 bwelling Exp $ */
#ifndef DNS_CACHE_H
#define DNS_CACHE_H 1
...
...
@@ -225,6 +225,16 @@ dns_cache_setcachesize(dns_cache_t *cache, isc_uint32_t size);
* Set the maximum cache size. 0 means unlimited.
*/
isc_result_t
dns_cache_flush
(
dns_cache_t
*
cache
);
/*
* Flushes all data from the cache.
*
* Returns:
* ISC_R_SUCCESS
* ISC_R_NOMEMORY
*/
ISC_LANG_ENDDECLS
#endif
/* DNS_CACHE_H */
lib/dns/include/dns/view.h
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: view.h,v 1.
69
2001/0
3/26
2
1
:3
3:04
bwelling Exp $ */
/* $Id: view.h,v 1.
70
2001/0
4/11
2
0
:3
7:50
bwelling Exp $ */
#ifndef DNS_VIEW_H
#define DNS_VIEW_H 1
...
...
@@ -666,6 +666,21 @@ dns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
* others An error occurred (see dns_master_dump)
*/
isc_result_t
dns_view_flushcache
(
dns_view_t
*
view
);
/*
* Flush the view's cache (and ADB).
*
* Requires:
* 'view' is valid.
*
* No other tasks are executing.
*
* Returns:
* ISC_R_SUCCESS
* ISC_R_NOMEMORY
*/
ISC_LANG_ENDDECLS
#endif
/* DNS_VIEW_H */
lib/dns/resolver.c
View file @
c20ffa38
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.21
4
2001/0
3/26
2
1
:3
2:58
bwelling Exp $ */
/* $Id: resolver.c,v 1.21
5
2001/0
4/11
2
0
:3
7:44
bwelling Exp $ */
#include
<config.h>
...
...
@@ -173,6 +173,8 @@ struct fetchctx {
dns_fwdpolicy_t
fwdpolicy
;
isc_sockaddrlist_t
bad
;
ISC_LIST
(
dns_validator_t
)
validators
;
dns_db_t
*
cache
;
dns_adb_t
*
adb
;
/*
* The number of events we're waiting for.
...
...
@@ -406,8 +408,7 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
*/
factor
=
DNS_ADB_RTTADJREPLACE
;
}
dns_adb_adjustsrtt
(
fctx
->
res
->
view
->
adb
,
query
->
addrinfo
,
rtt
,
factor
);
dns_adb_adjustsrtt
(
fctx
->
adb
,
query
->
addrinfo
,
rtt
,
factor
);
}
if
(
query
->
dispentry
!=
NULL
)
...
...
@@ -491,7 +492,7 @@ fctx_cleanupforwaddrs(fetchctx_t *fctx) {
addr
=
next_addr
)
{
next_addr
=
ISC_LIST_NEXT
(
addr
,
publink
);
ISC_LIST_UNLINK
(
fctx
->
forwaddrs
,
addr
,
publink
);
dns_adb_freeaddrinfo
(
fctx
->
res
->
view
->
adb
,
&
addr
);
dns_adb_freeaddrinfo
(
fctx
->
adb
,
&
addr
);
}
}
...
...
@@ -976,7 +977,7 @@ resquery_send(resquery_t *query) {
!
useedns
)
{
query
->
options
|=
DNS_FETCHOPT_NOEDNS0
;
dns_adb_changeflags
(
fctx
->
res
->
view
->
adb
,
dns_adb_changeflags
(
fctx
->
adb
,
query
->
addrinfo
,
DNS_FETCHOPT_NOEDNS0
,
DNS_FETCHOPT_NOEDNS0
);
...
...
@@ -1477,7 +1478,7 @@ fctx_getaddresses(fetchctx_t *fctx) {
while
(
sa
!=
NULL
)
{
ai
=
NULL
;
result
=
dns_adb_findaddrinfo
(
fctx
->
res
->
view
->
adb
,
result
=
dns_adb_findaddrinfo
(
fctx
->
adb
,
sa
,
&
ai
,
0
);
/* XXXMLG */
if
(
result
==
ISC_R_SUCCESS
)
{
ai
->
flags
|=
FCTX_ADDRINFO_FORWARDER
;
...
...
@@ -1556,7 +1557,7 @@ fctx_getaddresses(fetchctx_t *fctx) {
* See what we know about this address.
*/
find
=
NULL
;
result
=
dns_adb_createfind
(
res
->
view
->
adb
,
result
=
dns_adb_createfind
(
fctx
->
adb
,
res
->
buckets
[
fctx
->
bucketnum
].
task
,
fctx_finddone
,
fctx
,
&
ns
.
name
,
&
fctx
->
domain
,
options
,
now
,
NULL
,
...
...
@@ -1848,6 +1849,8 @@ fctx_destroy(fetchctx_t *fctx) {
if
(
dns_rdataset_isassociated
(
&
fctx
->
nameservers
))
dns_rdataset_disassociate
(
&
fctx
->
nameservers
);
dns_name_free
(
&
fctx
->
name
,
res
->
mctx
);
dns_db_detach
(
&
fctx
->
cache
);
dns_adb_detach
(
&
fctx
->
adb
);
isc_mem_put
(
res
->
mctx
,
fctx
,
sizeof
*
fctx
);
if
(
res
->
buckets
[
bucketnum
].
exiting
&&
...
...
@@ -2258,6 +2261,14 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
goto
cleanup_rmessage
;
}
/*
* Attach to the view's cache and adb.
*/
fctx
->
cache
=
NULL
;
dns_db_attach
(
res
->
view
->
cachedb
,
&
fctx
->
cache
);
fctx
->
adb
=
NULL
;
dns_adb_attach
(
res
->
view
->
adb
,
&
fctx
->
adb
);
ISC_LIST_INIT
(
fctx
->
events
);
ISC_LINK_INIT
(
fctx
,
link
);
fctx
->
magic
=
FCTX_MAGIC
;
...
...
@@ -2558,20 +2569,17 @@ validated(isc_task_t *task, isc_event_t *event) {
if
(
vevent
->
result
!=
ISC_R_SUCCESS
)
{
FCTXTRACE
(
"validation failed"
);
if
(
vevent
->
rdataset
!=
NULL
)
{
result
=
dns_db_findnode
(
fctx
->
res
->
view
->
cachedb
,
vevent
->
name
,
ISC_TRUE
,
&
node
);
result
=
dns_db_findnode
(
fctx
->
cache
,
vevent
->
name
,
ISC_TRUE
,
&
node
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
noanswer_response
;
(
void
)
dns_db_deleterdataset
(
fctx
->
res
->
view
->
cachedb
,
node
,
NULL
,
(
void
)
dns_db_deleterdataset
(
fctx
->
cache
,
node
,
NULL
,
vevent
->
type
,
0
);
if
(
vevent
->
sigrdataset
!=
NULL
)
(
void
)
dns_db_deleterdataset
(
fctx
->
res
->
view
->
cachedb
,
node
,
NULL
,
dns_rdatatype_sig
,
vevent
->
type
);
(
void
)
dns_db_deleterdataset
(
fctx
->
cache
,
node
,
NULL
,
dns_rdatatype_sig
,
vevent
->
type
);
}
result
=
vevent
->
result
;
goto
noanswer_response
;
...
...
@@ -2588,8 +2596,8 @@ validated(isc_task_t *task, isc_event_t *event) {
else
covers
=
fctx
->
type
;
result
=
dns_db_findnode
(
fctx
->
res
->
view
->
cachedb
,
vevent
->
name
,
ISC_TRUE
,
&
node
);
result
=
dns_db_findnode
(
fctx
->
cache
,
vevent
->
name
,
ISC_TRUE
,
&
node
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
noanswer_response
;
...
...
@@ -2603,8 +2611,7 @@ validated(isc_task_t *task, isc_event_t *event) {
covers
==
dns_rdatatype_any
)
ttl
=
0
;
result
=
ncache_adderesult
(
fctx
->
rmessage
,
fctx
->
res
->
view
->
cachedb
,
node
,
result
=
ncache_adderesult
(
fctx
->
rmessage
,
fctx
->
cache
,
node
,
covers
,
now
,
ttl
,
ardataset
,
&
eresult
);
if
(
result
!=
ISC_R_SUCCESS
)
...
...
@@ -2621,21 +2628,17 @@ validated(isc_task_t *task, isc_event_t *event) {
* rdatasets to the first event on the fetch
* event list.
*/
result
=
dns_db_findnode
(
fctx
->
res
->
view
->
cachedb
,
vevent
->
name
,
ISC_TRUE
,
&
node
);
result
=
dns_db_findnode
(
fctx
->
cache
,
vevent
->
name
,
ISC_TRUE
,
&
node
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
noanswer_response
;
result
=
dns_db_addrdataset
(
fctx
->
res
->
view
->
cachedb
,
node
,
NULL
,
now
,
vevent
->
rdataset
,
0
,
ardataset
);
result
=
dns_db_addrdataset
(
fctx
->
cache
,
node
,
NULL
,
now
,
vevent
->
rdataset
,
0
,
ardataset
);
if
(
result
!=
ISC_R_SUCCESS
&&
result
!=
DNS_R_UNCHANGED
)
goto
noanswer_response
;
if
(
vevent
->
sigrdataset
!=
NULL
)
{
result
=
dns_db_addrdataset
(
fctx
->
res
->
view
->
cachedb
,
node
,
NULL
,
now
,
result
=
dns_db_addrdataset
(
fctx
->
cache
,
node
,
NULL
,
now
,
vevent
->
sigrdataset
,
0
,
asigrdataset
);
if
(
result
!=
ISC_R_SUCCESS
&&
...
...
@@ -2680,7 +2683,7 @@ validated(isc_task_t *task, isc_event_t *event) {
hevent
->
result
=
eresult
;
dns_name_copy
(
vevent
->
name
,
dns_fixedname_name
(
&
hevent
->
foundname
),
NULL
);
dns_db_attach
(
fctx
->
res
->
view
->
cache
db
,
&
hevent
->
db
);
dns_db_attach
(
fctx
->
cache
,
&
hevent
->
db
);
hevent
->
node
=
node
;
node
=
NULL
;
clone_results
(
fctx
);
...
...
@@ -2688,7 +2691,7 @@ validated(isc_task_t *task, isc_event_t *event) {
noanswer_response:
if
(
node
!=
NULL
)
dns_db_detachnode
(
fctx
->
res
->
view
->
cache
db
,
&
node
);
dns_db_detachnode
(
fctx
->
cache
,
&
node
);
fctx_done
(
fctx
,
result
);
...
...
@@ -2773,7 +2776,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
* Find or create the cache node.
*/
node
=
NULL
;
result
=
dns_db_findnode
(
res
->
view
->
cache
db
,
name
,
ISC_TRUE
,
&
node
);
result
=
dns_db_findnode
(
fctx
->
cache
,
name
,
ISC_TRUE
,
&
node
);
if
(
result
!=
ISC_R_SUCCESS
)
return
(
result
);
...
...
@@ -2843,9 +2846,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
addedrdataset
=
ardataset
;
else
addedrdataset
=
NULL
;
result
=
dns_db_addrdataset
(
res
->
view
->
cachedb
,
node
,
NULL
,
now
,
rdataset
,
0
,
result
=
dns_db_addrdataset
(
fctx
->
cache
,
node
,
NULL
,
now
,
rdataset
,
0
,
addedrdataset
);
if
(
result
==
DNS_R_UNCHANGED
)
result
=
ISC_R_SUCCESS
;
...
...
@@ -2856,7 +2858,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
addedrdataset
=
asigrdataset
;
else
addedrdataset
=
NULL
;
result
=
dns_db_addrdataset
(
res
->
view
->
cache
db
,
result
=
dns_db_addrdataset
(
fctx
->
cache
,
node
,
NULL
,
now
,
sigrdataset
,
0
,
addedrdataset
);
...
...
@@ -2943,7 +2945,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
/*
* Now we can add the rdataset.
*/
result
=
dns_db_addrdataset
(
res
->
view
->
cache
db
,
result
=
dns_db_addrdataset
(
fctx
->
cache
,
node
,
NULL
,
now
,
rdataset
,
options
,
...
...
@@ -2993,7 +2995,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
fctx
->
attributes
|=
FCTX_ATTR_HAVEANSWER
;
if
(
event
!=
NULL
)
{
event
->
result
=
eresult
;
dns_db_attach
(
res
->
view
->
cache
db
,
adbp
);
dns_db_attach
(
fctx
->
cache
,
adbp
);
*
anodep
=
node
;
node
=
NULL
;
clone_results
(
fctx
);
...
...
@@ -3001,7 +3003,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
}
if
(
node
!=
NULL
)
dns_db_detachnode
(
res
->
view
->
cache
db
,
&
node
);
dns_db_detachnode
(
fctx
->
cache
,
&
node
);
return
(
result
);
}
...
...
@@ -3200,8 +3202,7 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {
event
=
NULL
;
node
=
NULL
;
result
=
dns_db_findnode
(
res
->
view
->
cachedb
,
name
,
ISC_TRUE
,
&
node
);
result
=
dns_db_findnode
(
fctx
->
cache
,
name
,
ISC_TRUE
,
&
node
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
unlock
;
...
...
@@ -3215,7 +3216,7 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {
covers
==
dns_rdatatype_any
)
ttl
=
0
;
result
=
ncache_adderesult
(
fctx
->
rmessage
,
res
->
view
->
cache
db
,
node
,
result
=
ncache_adderesult
(
fctx
->
rmessage
,
fctx
->
cache
,
node
,
covers
,
now
,
ttl
,
ardataset
,
&
eresult
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
unlock
;
...
...
@@ -3224,7 +3225,7 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {
fctx
->
attributes
|=
FCTX_ATTR_HAVEANSWER
;
if
(
event
!=
NULL
)
{
event
->
result
=
eresult
;
dns_db_attach
(
res
->
view
->
cache
db
,
adbp
);
dns_db_attach
(
fctx
->
cache
,
adbp
);
*
anodep
=
node
;
node
=
NULL
;
clone_results
(
fctx
);
...
...
@@ -3235,7 +3236,7 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {