Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
633
Issues
633
List
Boards
Labels
Service Desk
Milestones
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
98a7f8c7
Commit
98a7f8c7
authored
Sep 28, 2015
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4222. [func] Bias IPv6 servers when selecting the next server to
query. [RT #40836]
parent
8d80b493
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
25 deletions
+86
-25
CHANGES
CHANGES
+3
-0
bin/named/config.c
bin/named/config.c
+1
-0
bin/named/server.c
bin/named/server.c
+5
-0
doc/arm/Bv9ARM-book.xml
doc/arm/Bv9ARM-book.xml
+12
-0
doc/misc/options
doc/misc/options
+2
-0
lib/dns/include/dns/view.h
lib/dns/include/dns/view.h
+1
-0
lib/dns/resolver.c
lib/dns/resolver.c
+42
-10
lib/dns/view.c
lib/dns/view.c
+1
-0
lib/isccfg/namedconf.c
lib/isccfg/namedconf.c
+19
-15
No files found.
CHANGES
View file @
98a7f8c7
4222. [func] Bias IPv6 servers when selecting the next server to
query. [RT #40836]
4221. [bug] Resource leak on DNS_R_NXDOMAIN in fctx_create.
[RT #40583]
...
...
bin/named/config.c
View file @
98a7f8c7
...
...
@@ -184,6 +184,7 @@ options {\n\
allow-new-zones no;
\n
\
fetches-per-server 0;
\n
\
require-server-cookie no;
\n
\
v6-bias 50;
\n
\
"
#ifdef HAVE_GEOIP
"\
...
...
bin/named/server.c
View file @
98a7f8c7
...
...
@@ -3542,6 +3542,11 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
INSIST(result == ISC_R_SUCCESS);
view->requireservercookie = cfg_obj_asboolean(obj);
obj = NULL;
result = ns_config_get(maps, "v6-bias", &obj);
INSIST(result == ISC_R_SUCCESS);
view->v6bias = cfg_obj_asuint32(obj) * 1000;
obj = NULL;
result = ns_config_get(maps, "max-clients-per-query", &obj);
INSIST(result == ISC_R_SUCCESS);
...
...
doc/arm/Bv9ARM-book.xml
View file @
98a7f8c7
...
...
@@ -5035,6 +5035,7 @@ badresp:1,adberr:0,findfail:0,valfail:0]
<optional> min-ns-dots <replaceable>number</replaceable> </optional>
<optional> qname-wait-recurse <replaceable>yes_or_no</replaceable> </optional>
; </optional>
<optional>v6-bias <replaceable>number</replaceable> ; </optional>
};
</programlisting>
...
...
@@ -9590,6 +9591,17 @@ avoid-v6-udp-ports { 40000; range 50000 60000; };
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>v6-bias</command></term>
<listitem>
<para>
When determining the next nameserver to try
preference IPv6 nameservers by this many milliseconds.
The default is <literal>50</literal> milliseconds.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect3>
...
...
doc/misc/options
View file @
98a7f8c7
...
...
@@ -314,6 +314,7 @@ options {
use-queryport-pool <boolean>; // obsolete
use-v4-udp-ports { <portrange>; ... };
use-v6-udp-ports { <portrange>; ... };
v6-bias <integer>;
version ( <quoted_string> | none );
zero-no-soa-ttl <boolean>;
zero-no-soa-ttl-cache <boolean>;
...
...
@@ -587,6 +588,7 @@ view <string> [ <class> ] {
update-check-ksk <boolean>;
use-alt-transfer-source <boolean>;
use-queryport-pool <boolean>; // obsolete
v6-bias <integer>;
zero-no-soa-ttl <boolean>;
zero-no-soa-ttl-cache <boolean>;
zone <string> [ <class> ] {
...
...
lib/dns/include/dns/view.h
View file @
98a7f8c7
...
...
@@ -216,6 +216,7 @@ struct dns_view {
void
(
*
cfg_destroy
)(
void
**
);
unsigned
char
secret
[
32
];
/* Client secret */
unsigned
int
v6bias
;
};
#define DNS_VIEW_MAGIC ISC_MAGIC('V','i','e','w')
...
...
lib/dns/resolver.c
View file @
98a7f8c7
...
...
@@ -2933,18 +2933,32 @@ add_bad(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, isc_result_t reason,
* Sort addrinfo list by RTT.
*/
static
void
sort_adbfind
(
dns_adbfind_t
*
find
)
{
sort_adbfind
(
dns_adbfind_t
*
find
,
unsigned
int
bias
)
{
dns_adbaddrinfo_t
*
best
,
*
curr
;
dns_adbaddrinfolist_t
sorted
;
int
family
;
/* Lame N^2 bubble sort. */
ISC_LIST_INIT
(
sorted
);
while
(
!
ISC_LIST_EMPTY
(
find
->
list
))
{
best
=
ISC_LIST_HEAD
(
find
->
list
);
family
=
isc_sockaddr_pf
(
&
best
->
sockaddr
);
curr
=
ISC_LIST_NEXT
(
best
,
publink
);
while
(
curr
!=
NULL
)
{
if
(
isc_sockaddr_pf
(
&
curr
->
sockaddr
)
==
family
)
{
if
(
curr
->
srtt
<
best
->
srtt
)
best
=
curr
;
}
else
if
(
family
==
AF_INET6
)
{
if
(
curr
->
srtt
+
bias
<
best
->
srtt
)
{
best
=
curr
;
family
=
AF_INET
;
}
}
else
{
if
(
curr
->
srtt
<
best
->
srtt
+
bias
)
{
best
=
curr
;
family
=
AF_INET6
;
}
}
curr
=
ISC_LIST_NEXT
(
curr
,
publink
);
}
ISC_LIST_UNLINK
(
find
->
list
,
best
,
publink
);
...
...
@@ -2957,16 +2971,17 @@ sort_adbfind(dns_adbfind_t *find) {
* Sort a list of finds by server RTT.
*/
static
void
sort_finds
(
dns_adbfindlist_t
*
findlist
)
{
sort_finds
(
dns_adbfindlist_t
*
findlist
,
unsigned
int
bias
)
{
dns_adbfind_t
*
best
,
*
curr
;
dns_adbfindlist_t
sorted
;
dns_adbaddrinfo_t
*
addrinfo
,
*
bestaddrinfo
;
int
family
;
/* Sort each find's addrinfo list by SRTT. */
for
(
curr
=
ISC_LIST_HEAD
(
*
findlist
);
curr
!=
NULL
;
curr
=
ISC_LIST_NEXT
(
curr
,
publink
))
sort_adbfind
(
curr
);
sort_adbfind
(
curr
,
bias
);
/* Lame N^2 bubble sort. */
ISC_LIST_INIT
(
sorted
);
...
...
@@ -2974,14 +2989,31 @@ sort_finds(dns_adbfindlist_t *findlist) {
best
=
ISC_LIST_HEAD
(
*
findlist
);
bestaddrinfo
=
ISC_LIST_HEAD
(
best
->
list
);
INSIST
(
bestaddrinfo
!=
NULL
);
family
=
isc_sockaddr_pf
(
&
bestaddrinfo
->
sockaddr
);
curr
=
ISC_LIST_NEXT
(
best
,
publink
);
while
(
curr
!=
NULL
)
{
addrinfo
=
ISC_LIST_HEAD
(
curr
->
list
);
INSIST
(
addrinfo
!=
NULL
);
if
(
isc_sockaddr_pf
(
&
addrinfo
->
sockaddr
)
==
family
)
{
if
(
addrinfo
->
srtt
<
bestaddrinfo
->
srtt
)
{
best
=
curr
;
bestaddrinfo
=
addrinfo
;
}
}
else
if
(
family
==
AF_INET6
)
{
if
(
addrinfo
->
srtt
+
bias
<
bestaddrinfo
->
srtt
)
{
best
=
curr
;
bestaddrinfo
=
addrinfo
;
family
=
AF_INET
;
}
}
else
{
if
(
addrinfo
->
srtt
<
bestaddrinfo
->
srtt
+
bias
)
{
best
=
curr
;
bestaddrinfo
=
addrinfo
;
family
=
AF_INET6
;
}
}
curr
=
ISC_LIST_NEXT
(
curr
,
publink
);
}
ISC_LIST_UNLINK
(
*
findlist
,
best
,
publink
);
...
...
@@ -3394,8 +3426,8 @@ fctx_getaddresses(fetchctx_t *fctx, isc_boolean_t badcache) {
* We've found some addresses. We might still be looking
* for more addresses.
*/
sort_finds
(
&
fctx
->
finds
);
sort_finds
(
&
fctx
->
altfinds
);
sort_finds
(
&
fctx
->
finds
,
res
->
view
->
v6bias
);
sort_finds
(
&
fctx
->
altfinds
,
0
);
result
=
ISC_R_SUCCESS
;
}
...
...
lib/dns/view.c
View file @
98a7f8c7
...
...
@@ -240,6 +240,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
view
->
cfg_destroy
=
NULL
;
view
->
fail_ttl
=
0
;
view
->
failcache
=
NULL
;
view
->
v6bias
=
0
;
dns_badcache_init
(
view
->
mctx
,
DNS_VIEW_FAILCACHESIZE
,
&
view
->
failcache
);
if
(
isc_bind9
)
{
...
...
lib/isccfg/namedconf.c
View file @
98a7f8c7
...
...
@@ -1578,6 +1578,18 @@ view_clauses[] = {
{
"fetch-quota-params"
,
&
cfg_type_fetchquota
,
0
},
{
"fetches-per-server"
,
&
cfg_type_fetchesper
,
0
},
{
"fetches-per-zone"
,
&
cfg_type_fetchesper
,
0
},
#ifdef ALLOW_FILTER_AAAA
{
"filter-aaaa"
,
&
cfg_type_bracketed_aml
,
0
},
{
"filter-aaaa-on-v4"
,
&
cfg_type_filter_aaaa
,
0
},
{
"filter-aaaa-on-v6"
,
&
cfg_type_filter_aaaa
,
0
},
#else
{
"filter-aaaa"
,
&
cfg_type_bracketed_aml
,
CFG_CLAUSEFLAG_NOTCONFIGURED
},
{
"filter-aaaa-on-v4"
,
&
cfg_type_filter_aaaa
,
CFG_CLAUSEFLAG_NOTCONFIGURED
},
{
"filter-aaaa-on-v6"
,
&
cfg_type_filter_aaaa
,
CFG_CLAUSEFLAG_NOTCONFIGURED
},
#endif
{
"ixfr-from-differences"
,
&
cfg_type_ixfrdifftype
,
0
},
{
"lame-ttl"
,
&
cfg_type_ttlval
,
0
},
{
"nocookie-udp-size"
,
&
cfg_type_uint32
,
0
},
...
...
@@ -1608,11 +1620,13 @@ view_clauses[] = {
{
"queryport-pool-ports"
,
&
cfg_type_uint32
,
CFG_CLAUSEFLAG_OBSOLETE
},
{
"queryport-pool-updateinterval"
,
&
cfg_type_uint32
,
CFG_CLAUSEFLAG_OBSOLETE
},
{
"rate-limit"
,
&
cfg_type_rrl
,
0
},
{
"recursion"
,
&
cfg_type_boolean
,
0
},
{
"request-sit"
,
&
cfg_type_boolean
,
CFG_CLAUSEFLAG_OBSOLETE
},
{
"request-nsid"
,
&
cfg_type_boolean
,
0
},
{
"require-server-cookie"
,
&
cfg_type_boolean
,
0
},
{
"resolver-query-timeout"
,
&
cfg_type_uint32
,
0
},
{
"response-policy"
,
&
cfg_type_rpz
,
0
},
{
"rfc2308-type1"
,
&
cfg_type_boolean
,
CFG_CLAUSEFLAG_NYI
},
{
"root-delegation-only"
,
&
cfg_type_optional_exclude
,
0
},
{
"rrset-order"
,
&
cfg_type_rrsetorder
,
0
},
...
...
@@ -1623,21 +1637,8 @@ view_clauses[] = {
{
"topology"
,
&
cfg_type_bracketed_aml
,
CFG_CLAUSEFLAG_NOTIMP
},
{
"transfer-format"
,
&
cfg_type_transferformat
,
0
},
{
"use-queryport-pool"
,
&
cfg_type_boolean
,
CFG_CLAUSEFLAG_OBSOLETE
},
{
"v6-bias"
,
&
cfg_type_uint32
,
0
},
{
"zero-no-soa-ttl-cache"
,
&
cfg_type_boolean
,
0
},
#ifdef ALLOW_FILTER_AAAA
{
"filter-aaaa"
,
&
cfg_type_bracketed_aml
,
0
},
{
"filter-aaaa-on-v4"
,
&
cfg_type_filter_aaaa
,
0
},
{
"filter-aaaa-on-v6"
,
&
cfg_type_filter_aaaa
,
0
},
#else
{
"filter-aaaa"
,
&
cfg_type_bracketed_aml
,
CFG_CLAUSEFLAG_NOTCONFIGURED
},
{
"filter-aaaa-on-v4"
,
&
cfg_type_filter_aaaa
,
CFG_CLAUSEFLAG_NOTCONFIGURED
},
{
"filter-aaaa-on-v6"
,
&
cfg_type_filter_aaaa
,
CFG_CLAUSEFLAG_NOTCONFIGURED
},
#endif
{
"response-policy"
,
&
cfg_type_rpz
,
0
},
{
"rate-limit"
,
&
cfg_type_rrl
,
0
},
{
NULL
,
NULL
,
0
}
};
...
...
@@ -1815,8 +1816,11 @@ view_clausesets[] = {
zone_clauses
,
NULL
};
static
cfg_type_t
cfg_type_viewopts
=
{
"view"
,
cfg_parse_map
,
cfg_print_map
,
cfg_doc_map
,
&
cfg_rep_map
,
view_clausesets
};
"view"
,
cfg_parse_map
,
cfg_print_map
,
cfg_doc_map
,
&
cfg_rep_map
,
view_clausesets
};
/*% The "zone" statement syntax. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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