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
bfcdcde5
Commit
bfcdcde5
authored
Nov 08, 2000
by
Mark Andrews
Browse files
implement lame-ttl.
parent
ae97c3e7
Changes
7
Hide whitespace changes
Inline
Side-by-side
bin/named/server.c
View file @
bfcdcde5
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.2
39
2000/11/0
7 23:49:19 mws
Exp $ */
/* $Id: server.c,v 1.2
40
2000/11/0
8 03:53:05 marka
Exp $ */
#include
<config.h>
...
...
@@ -385,6 +385,7 @@ configure_view(dns_view_t *view, dns_c_ctx_t *cctx, dns_c_view_t *cview,
isc_result_t
result
;
isc_uint32_t
cleaning_interval
;
isc_uint32_t
max_cache_size
;
isc_uint32_t
lame_ttl
;
dns_tsig_keyring_t
*
ring
;
dns_c_iplist_t
*
forwarders
;
dns_view_t
*
pview
=
NULL
;
/* Production view */
...
...
@@ -499,6 +500,18 @@ configure_view(dns_view_t *view, dns_c_ctx_t *cctx, dns_c_view_t *cview,
if
(
dispatch6
!=
NULL
)
dns_dispatch_detach
(
&
dispatch6
);
/*
* Set resolver's lame-ttl.
*/
result
=
dns_c_view_getlamettl
(
cctx
,
&
lame_ttl
);
if
(
result
==
ISC_R_NOTFOUND
)
result
=
dns_c_ctx_getlamettl
(
cctx
,
&
lame_ttl
);
if
(
result
==
ISC_R_NOTFOUND
)
lame_ttl
=
600
;
if
(
lame_ttl
>
18000
)
lame_ttl
=
18000
;
dns_resolver_setlamettl
(
view
->
resolver
,
lame_ttl
);
/*
* Set resolver forwarding policy.
*/
...
...
doc/arm/Bv9ARM-book.xml
View file @
bfcdcde5
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
<!-- File: $Id: Bv9ARM-book.xml,v 1.3
2
2000/11/0
6 23:48:48 gson
Exp $ -->
<!-- File: $Id: Bv9ARM-book.xml,v 1.3
3
2000/11/0
8 03:53:07 marka
Exp $ -->
<book>
...
...
@@ -3389,8 +3389,6 @@ lame server indication. 0 disables caching. (This is
<emphasis
role=
"bold"
>
NOT
</emphasis>
recommended.)
Default is
<literal>
600
</literal>
(10 minutes). Maximum value is
<literal>
1800
</literal>
(30 minutes).
</para>
<note>
<simpara>
Not yet implemented in
<acronym>
BIND
</acronym>
9.
</simpara></note>
</entry>
</row>
<row
rowsep =
"0"
>
...
...
doc/misc/options
View file @
bfcdcde5
Copyright (C) 2000 Internet Software Consortium.
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
$Id: options,v 1.
39
2000/11/0
4
0
2:20:57 bwelling
Exp $
$Id: options,v 1.
40
2000/11/0
8
0
3:53:10 marka
Exp $
This is a summary of the implementation status of the various named.conf
options in BIND 9.
...
...
@@ -65,7 +65,7 @@ options {
[ listen-on-v6 [ port ip_port ] { address_match_list }; ] Yes*
[ query-source ... ] Yes
[ query-source-v6 ... ] Yes*
[ lame-ttl number; ]
No
[ lame-ttl number; ]
Yes
[ max-transfer-time-in number; ] Yes
[ max-transfer-idle-in number; ] Yes*
[ max-transfer-time-out number; ] Yes*
...
...
lib/dns/config/confctx.c
View file @
bfcdcde5
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: confctx.c,v 1.9
8
2000/11/0
7 23:49:31 mws
Exp $ */
/* $Id: confctx.c,v 1.9
9
2000/11/0
8 03:53:13 marka
Exp $ */
#include
<config.h>
...
...
@@ -446,13 +446,6 @@ dns_c_checkconfig(dns_c_ctx_t *cfg)
"option 'check-names' is not yet implemented"
);
}
if
(
dns_c_ctx_getlamettl
(
cfg
,
&
uintval
)
!=
ISC_R_NOTFOUND
)
{
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_CONFIG
,
DNS_LOGMODULE_CONFIG
,
ISC_LOG_WARNING
,
"option 'lame-ttl' is not yet "
"implemented"
);
}
if
(
dns_c_ctx_getminroots
(
cfg
,
&
uintval
)
!=
ISC_R_NOTFOUND
)
{
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_CONFIG
,
DNS_LOGMODULE_CONFIG
,
ISC_LOG_WARNING
,
...
...
lib/dns/config/confview.c
View file @
bfcdcde5
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: confview.c,v 1.5
4
2000/11/0
7 23:49:36 mws
Exp $ */
/* $Id: confview.c,v 1.5
5
2000/11/0
8 03:53:14 marka
Exp $ */
#include
<config.h>
...
...
@@ -411,12 +411,6 @@ dns_c_viewtable_checkviews(dns_c_viewtable_t *viewtable) {
"view 'max-cache-ttl' is not yet "
"implemented"
);
if
(
dns_c_view_getlamettl
(
elem
,
&
buival
)
!=
ISC_R_NOTFOUND
)
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_CONFIG
,
DNS_LOGMODULE_CONFIG
,
ISC_LOG_WARNING
,
"view 'lame-ttl' is not yet "
"implemented"
);
if
(
dns_c_view_getminroots
(
elem
,
&
buival
)
!=
ISC_R_NOTFOUND
)
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_CONFIG
,
DNS_LOGMODULE_CONFIG
,
ISC_LOG_WARNING
,
...
...
lib/dns/include/dns/resolver.h
View file @
bfcdcde5
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.h,v 1.3
2
2000/
08/24 22:15:36 bwelling
Exp $ */
/* $Id: resolver.h,v 1.3
3
2000/
11/08 03:53:16 marka
Exp $ */
#ifndef DNS_RESOLVER_H
#define DNS_RESOLVER_H 1
...
...
@@ -331,6 +331,24 @@ dns_resolver_socketmgr(dns_resolver_t *resolver);
isc_taskmgr_t
*
dns_resolver_taskmgr
(
dns_resolver_t
*
resolver
);
isc_uint32_t
dns_resolver_getlamettl
(
dns_resolver_t
*
resolver
);
/*
* Get the resolver's lame-ttl. zero => no lame processing.
*
* Requires:
* 'resolver' to be valid.
*/
void
dns_resolver_setlamettl
(
dns_resolver_t
*
resolver
,
isc_uint32_t
lame_ttl
);
/*
* Set the resolver's lame-ttl. zero => no lame processing.
*
* Requires:
* 'resolver' to be valid.
*/
ISC_LANG_ENDDECLS
#endif
/* DNS_RESOLVER_H */
lib/dns/resolver.c
View file @
bfcdcde5
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.17
8
2000/11/0
4
0
2:20:58 bwelling
Exp $ */
/* $Id: resolver.c,v 1.17
9
2000/11/0
8
0
3:53:11 marka
Exp $ */
#include
<config.h>
...
...
@@ -237,6 +237,7 @@ struct dns_resolver {
dns_dispatch_t
*
dispatchv6
;
unsigned
int
nbuckets
;
fctxbucket_t
*
buckets
;
isc_uint32_t
lame_ttl
;
/* Locked by lock. */
unsigned
int
references
;
isc_boolean_t
exiting
;
...
...
@@ -2179,6 +2180,64 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
/*
* Handle Responses
*/
static
inline
isc_boolean_t
is_lame
(
fetchctx_t
*
fctx
)
{
dns_message_t
*
message
=
fctx
->
rmessage
;
dns_name_t
*
name
;
dns_rdataset_t
*
rdataset
;
isc_result_t
result
;
if
(
message
->
rcode
!=
dns_rcode_noerror
&&
message
->
rcode
!=
dns_rcode_nxdomain
)
return
(
ISC_FALSE
);
if
(
message
->
counts
[
DNS_SECTION_ANSWER
]
!=
0
)
return
(
ISC_FALSE
);
if
(
message
->
counts
[
DNS_SECTION_AUTHORITY
]
==
0
)
return
(
ISC_FALSE
);
result
=
dns_message_firstname
(
message
,
DNS_SECTION_AUTHORITY
);
while
(
result
==
ISC_R_SUCCESS
)
{
name
=
NULL
;
dns_message_currentname
(
message
,
DNS_SECTION_AUTHORITY
,
&
name
);
for
(
rdataset
=
ISC_LIST_HEAD
(
name
->
list
);
rdataset
!=
NULL
;
rdataset
=
ISC_LIST_NEXT
(
rdataset
,
link
))
{
dns_namereln_t
namereln
;
int
order
;
unsigned
int
labels
,
bits
;
if
(
rdataset
->
type
!=
dns_rdatatype_ns
)
continue
;
namereln
=
dns_name_fullcompare
(
name
,
&
fctx
->
domain
,
&
order
,
&
labels
,
&
bits
);
if
(
namereln
==
dns_namereln_equal
&&
(
message
->
flags
&
DNS_MESSAGEFLAG_AA
)
==
0
)
return
(
ISC_TRUE
);
if
(
namereln
==
dns_namereln_subdomain
)
return
(
ISC_FALSE
);
return
(
ISC_TRUE
);
}
result
=
dns_message_nextname
(
message
,
DNS_SECTION_AUTHORITY
);
}
return
(
ISC_FALSE
);
}
static
inline
void
log_lame
(
fetchctx_t
*
fctx
,
dns_adbaddrinfo_t
*
addrinfo
)
{
char
namebuf
[
1024
];
char
domainbuf
[
1024
];
char
addrbuf
[
ISC_SOCKADDR_FORMATSIZE
];
dns_name_format
(
&
fctx
->
name
,
namebuf
,
sizeof
(
namebuf
));
dns_name_format
(
&
fctx
->
domain
,
domainbuf
,
sizeof
(
domainbuf
));
isc_sockaddr_format
(
&
addrinfo
->
sockaddr
,
addrbuf
,
sizeof
(
addrbuf
));
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_RESOLVER
,
DNS_LOGMODULE_RESOLVER
,
ISC_LOG_INFO
,
"Lame server on '%s' (in '%s'?): %s"
,
namebuf
,
domainbuf
,
addrbuf
);
}
static
inline
isc_result_t
same_question
(
fetchctx_t
*
fctx
)
{
...
...
@@ -4087,6 +4146,19 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
goto
done
;
}
/*
* Is the server lame?
*/
if
(
fctx
->
res
->
lame_ttl
!=
0
&&
!
ISFORWARDER
(
query
->
addrinfo
)
&&
is_lame
(
fctx
))
{
log_lame
(
fctx
,
query
->
addrinfo
);
dns_adb_marklame
(
fctx
->
res
->
view
->
adb
,
query
->
addrinfo
,
&
fctx
->
domain
,
now
+
fctx
->
res
->
lame_ttl
);
broken_server
=
ISC_TRUE
;
keep_trying
=
ISC_TRUE
;
goto
done
;
}
/*
* Did we get any answers?
*/
...
...
@@ -4369,6 +4441,7 @@ dns_resolver_create(dns_view_t *view,
res
->
dispatchmgr
=
dispatchmgr
;
res
->
view
=
view
;
res
->
options
=
options
;
res
->
lame_ttl
=
0
;
res
->
nbuckets
=
ntasks
;
res
->
activebuckets
=
ntasks
;
...
...
@@ -4952,3 +5025,15 @@ dns_resolver_taskmgr(dns_resolver_t *resolver) {
REQUIRE
(
VALID_RESOLVER
(
resolver
));
return
(
resolver
->
taskmgr
);
}
isc_uint32_t
dns_resolver_getlamettl
(
dns_resolver_t
*
resolver
)
{
REQUIRE
(
VALID_RESOLVER
(
resolver
));
return
(
resolver
->
lame_ttl
);
}
void
dns_resolver_setlamettl
(
dns_resolver_t
*
resolver
,
isc_uint32_t
lame_ttl
)
{
REQUIRE
(
VALID_RESOLVER
(
resolver
));
resolver
->
lame_ttl
=
lame_ttl
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment