]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #422: IPv6 fallback issues when IPv6 is not properly
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 15 Feb 2021 13:40:48 +0000 (14:40 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 15 Feb 2021 13:40:48 +0000 (14:40 +0100)
  enabled/configured.

daemon/worker.c
doc/Changelog
iterator/iter_utils.c
iterator/iter_utils.h

index 57d58a90d875c0a1638f97bc2cc61e3aa339b6f4..c56d7b469c89fdb27322c9c44dc766d816c72a62 100644 (file)
@@ -70,6 +70,7 @@
 #include "util/edns.h"
 #include "iterator/iter_fwd.h"
 #include "iterator/iter_hints.h"
+#include "iterator/iter_utils.h"
 #include "validator/autotrust.h"
 #include "validator/val_anchor.h"
 #include "respip/respip.h"
@@ -1821,6 +1822,8 @@ worker_init(struct worker* worker, struct config_file *cfg,
                worker_delete(worker);
                return 0;
        }
+       iterator_set_ip46_support(&worker->daemon->mods, worker->daemon->env,
+               worker->back);
        /* start listening to commands */
        if(!tube_setup_bg_listen(worker->cmd, worker->base,
                &worker_handle_control_cmd, worker)) {
index 5c7ac0c7df5c54409a88e06d0e93694d6f27bb6b..b5dbba8a9b9194f6138b6bafd3ff8de03f42a313 100644 (file)
@@ -1,3 +1,7 @@
+15 February 2021: Wouter
+       - Fix #422: IPv6 fallback issues when IPv6 is not properly
+         enabled/configured.
+
 10 February 2021: Wouter
        - Merge PR #420 from dyunwei: DOH not responsing with
          "http2_query_read_done failure" logged.
index 7bc67da69b2e8e463868d27a1a13c75952c89fa7..4edb1cfe67b767851fe2a4fe467f98cc559398c5 100644 (file)
@@ -50,6 +50,7 @@
 #include "services/cache/infra.h"
 #include "services/cache/dns.h"
 #include "services/cache/rrset.h"
+#include "services/outside_network.h"
 #include "util/net_help.h"
 #include "util/module.h"
 #include "util/log.h"
@@ -1435,3 +1436,17 @@ iter_stub_fwd_no_cache(struct module_qstate *qstate, struct query_info *qinf)
        }
        return 0;
 }
+
+void iterator_set_ip46_support(struct module_stack* mods,
+       struct module_env* env, struct outside_network* outnet)
+{
+       int m = modstack_find(mods, "iterator");
+       struct iter_env* ie = NULL;
+       if(m == -1)
+               return;
+       ie = (struct iter_env*)env->modinfo[m];
+       if(outnet->num_ip4 == 0)
+               ie->supports_ipv4 = 0;
+       if(outnet->num_ip6 == 0)
+               ie->supports_ipv6 = 0;
+}
index f771930bba2bac0847be935b9858fb53252bb884..a56be95ae8a1e76463ed22ba98e863966f15ff76 100644 (file)
@@ -59,6 +59,8 @@ struct reply_info;
 struct module_qstate;
 struct sock_list;
 struct ub_packed_rrset_key;
+struct module_stack;
+struct outside_network;
 
 /**
  * Process config options and set iterator module state.
@@ -385,4 +387,16 @@ int iter_dp_cangodown(struct query_info* qinfo, struct delegpt* dp);
 int iter_stub_fwd_no_cache(struct module_qstate *qstate,
        struct query_info *qinf);
 
+/**
+ * Set support for IP4 and IP6 depending on outgoing interfaces
+ * in the outside network.  If none, no support, so no use to lookup
+ * the AAAA and then attempt to use it if there is no outgoing-interface
+ * for it.
+ * @param mods: modstack to find iterator module in.
+ * @param env: module env, find iterator module (if one) in there.
+ * @param outnet: outside network structure.
+ */
+void iterator_set_ip46_support(struct module_stack* mods,
+       struct module_env* env, struct outside_network* outnet);
+
 #endif /* ITERATOR_ITER_UTILS_H */