mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-23 08:10:30 -05:00
- Fix operation in ipv6 only (do-ip4: no) mode.
git-svn-id: file:///svn/unbound/trunk@2487 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
70c8f304c2
commit
46eeced066
6 changed files with 32 additions and 2 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
7 September 2011: Wouter
|
||||||
|
- Fix operation in ipv6 only (do-ip4: no) mode.
|
||||||
|
|
||||||
6 September 2011: Wouter
|
6 September 2011: Wouter
|
||||||
- fedora specfile updated.
|
- fedora specfile updated.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -482,3 +482,13 @@ void delegpt_no_ipv6(struct delegpt* dp)
|
||||||
ns->resolved = 1;
|
ns->resolved = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void delegpt_no_ipv4(struct delegpt* dp)
|
||||||
|
{
|
||||||
|
struct delegpt_ns* ns;
|
||||||
|
for(ns = dp->nslist; ns; ns = ns->next) {
|
||||||
|
/* no ipv4, so only ipv6 is enough to resolve a nameserver */
|
||||||
|
if(ns->got6)
|
||||||
|
ns->resolved = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -339,4 +339,11 @@ void delegpt_add_neg_msg(struct delegpt* dp, struct msgreply_entry* msg);
|
||||||
*/
|
*/
|
||||||
void delegpt_no_ipv6(struct delegpt* dp);
|
void delegpt_no_ipv6(struct delegpt* dp);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the fact that there is no ipv4 and thus As are not going
|
||||||
|
* to be queried for or be useful.
|
||||||
|
* @param dp: the delegation point. Updated to reflect no ipv4.
|
||||||
|
*/
|
||||||
|
void delegpt_no_ipv4(struct delegpt* dp);
|
||||||
|
|
||||||
#endif /* ITERATOR_ITER_DELEGPT_H */
|
#endif /* ITERATOR_ITER_DELEGPT_H */
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ iter_apply_cfg(struct iter_env* iter_env, struct config_file* cfg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
iter_env->supports_ipv6 = cfg->do_ip6;
|
iter_env->supports_ipv6 = cfg->do_ip6;
|
||||||
|
iter_env->supports_ipv4 = cfg->do_ip4;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,6 +151,7 @@ iter_apply_cfg(struct iter_env* iter_env, struct config_file* cfg)
|
||||||
* o The address is bogus (DNSSEC validation failure).
|
* o The address is bogus (DNSSEC validation failure).
|
||||||
* o Listed as donotquery
|
* o Listed as donotquery
|
||||||
* o is ipv6 but no ipv6 support (in operating system).
|
* o is ipv6 but no ipv6 support (in operating system).
|
||||||
|
* o is ipv4 but no ipv4 support (in operating system).
|
||||||
* o is lame
|
* o is lame
|
||||||
* Otherwise, an rtt in milliseconds.
|
* Otherwise, an rtt in milliseconds.
|
||||||
* 0 .. USEFUL_SERVER_TOP_TIMEOUT-1
|
* 0 .. USEFUL_SERVER_TOP_TIMEOUT-1
|
||||||
|
|
@ -194,6 +196,9 @@ iter_filter_unsuitable(struct iter_env* iter_env, struct module_env* env,
|
||||||
if(!iter_env->supports_ipv6 && addr_is_ip6(&a->addr, a->addrlen)) {
|
if(!iter_env->supports_ipv6 && addr_is_ip6(&a->addr, a->addrlen)) {
|
||||||
return -1; /* there is no ip6 available */
|
return -1; /* there is no ip6 available */
|
||||||
}
|
}
|
||||||
|
if(!iter_env->supports_ipv4 && !addr_is_ip6(&a->addr, a->addrlen)) {
|
||||||
|
return -1; /* there is no ip4 available */
|
||||||
|
}
|
||||||
/* check lameness - need zone , class info */
|
/* check lameness - need zone , class info */
|
||||||
if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen,
|
if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen,
|
||||||
name, namelen, qtype, &lame, &dnsseclame, &reclame,
|
name, namelen, qtype, &lame, &dnsseclame, &reclame,
|
||||||
|
|
|
||||||
|
|
@ -1367,7 +1367,7 @@ query_for_targets(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||||
query_count++;
|
query_count++;
|
||||||
}
|
}
|
||||||
/* Send the A request. */
|
/* Send the A request. */
|
||||||
if(!ns->got4) {
|
if(ie->supports_ipv4 && !ns->got4) {
|
||||||
if(!generate_target_query(qstate, iq, id,
|
if(!generate_target_query(qstate, iq, id,
|
||||||
ns->name, ns->namelen,
|
ns->name, ns->namelen,
|
||||||
LDNS_RR_TYPE_A, iq->qchase.qclass)) {
|
LDNS_RR_TYPE_A, iq->qchase.qclass)) {
|
||||||
|
|
@ -1476,7 +1476,7 @@ processLastResort(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||||
ns->done_pside6 = 1;
|
ns->done_pside6 = 1;
|
||||||
query_count++;
|
query_count++;
|
||||||
}
|
}
|
||||||
if(!ns->done_pside4) {
|
if(ie->supports_ipv4 && !ns->done_pside4) {
|
||||||
/* Send the A request. */
|
/* Send the A request. */
|
||||||
if(!generate_parentside_target_query(qstate, iq, id,
|
if(!generate_parentside_target_query(qstate, iq, id,
|
||||||
ns->name, ns->namelen,
|
ns->name, ns->namelen,
|
||||||
|
|
@ -1556,6 +1556,8 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||||
}
|
}
|
||||||
if(!ie->supports_ipv6)
|
if(!ie->supports_ipv6)
|
||||||
delegpt_no_ipv6(iq->dp);
|
delegpt_no_ipv6(iq->dp);
|
||||||
|
if(!ie->supports_ipv4)
|
||||||
|
delegpt_no_ipv4(iq->dp);
|
||||||
delegpt_log(VERB_ALGO, iq->dp);
|
delegpt_log(VERB_ALGO, iq->dp);
|
||||||
|
|
||||||
if(iq->num_current_queries>0) {
|
if(iq->num_current_queries>0) {
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,9 @@ struct iter_env {
|
||||||
/** A flag to indicate whether or not we have an IPv6 route */
|
/** A flag to indicate whether or not we have an IPv6 route */
|
||||||
int supports_ipv6;
|
int supports_ipv6;
|
||||||
|
|
||||||
|
/** A flag to indicate whether or not we have an IPv4 route */
|
||||||
|
int supports_ipv4;
|
||||||
|
|
||||||
/** A set of inetaddrs that should never be queried. */
|
/** A set of inetaddrs that should never be queried. */
|
||||||
struct iter_donotq* donotq;
|
struct iter_donotq* donotq;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue