]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix when the mesh jostle is exceeded that nameserver targets are
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 May 2024 07:50:35 +0000 (09:50 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 May 2024 07:50:35 +0000 (09:50 +0200)
  marked as resolved, so that the lookup is not stuck on the
  requestlist.

doc/Changelog
iterator/iterator.c

index 24ae5f04ae3df917cfc20d96d497dd2444c24cbd..7dcd3d4919eb3654307a28fd38fa763dd20fa4c7 100644 (file)
@@ -1,3 +1,8 @@
+10 May 2024: Wouter
+       - Fix when the mesh jostle is exceeded that nameserver targets are
+         marked as resolved, so that the lookup is not stuck on the
+         requestlist.
+
 8 May 2024: Wouter
        - Fix to squelch udp connect errors in the log at low verbosity about
          invalid argument for IPv6 link local addresses.
index 5732a414857e7f4876075bee6757de2870e61b05..7863e721498fc4524014521c6f282cea58a34b78 100644 (file)
@@ -2057,8 +2057,16 @@ query_for_targets(struct module_qstate* qstate, struct iter_qstate* iq,
                         * increase, because the spawned state uses cpu and a
                         * socket while this state waits for that spawned
                         * state. Next time we can look up further targets */
-                       if(mesh_jostle_exceeded(qstate->env->mesh))
+                       if(mesh_jostle_exceeded(qstate->env->mesh)) {
+                               /* If no ip4 query is possible, that makes
+                                * this ns resolved. */
+                               if(!((ie->supports_ipv4 || ie->use_nat64) &&
+                                       ((ns->lame && !ns->done_pside4) ||
+                                       (!ns->lame && !ns->got4)))) {
+                                       ns->resolved = 1;
+                               }
                                break;
+                       }
                }
                /* Send the A request. */
                if((ie->supports_ipv4 || ie->use_nat64) &&
@@ -2074,8 +2082,13 @@ query_for_targets(struct module_qstate* qstate, struct iter_qstate* iq,
                        }
                        query_count++;
                        /* If the mesh query list is full, exit the loop. */
-                       if(mesh_jostle_exceeded(qstate->env->mesh))
+                       if(mesh_jostle_exceeded(qstate->env->mesh)) {
+                               /* With the ip6 query already checked for,
+                                * this makes the ns resolved. It is no longer
+                                * a missing target. */
+                               ns->resolved = 1;
                                break;
+                       }
                }
 
                /* mark this target as in progress. */
@@ -2902,6 +2915,17 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                                         * so this is not a loop. */
                                        return 1;
                                }
+                               if(qs == 0) {
+                                       /* There should be targets now, and
+                                        * if there are not, it should not
+                                        * wait for no targets. Stop it from
+                                        * waiting forever, or looping to
+                                        * here, as a safeguard. */
+                                       errinf(qstate, "could not generate nameserver lookups");
+                                       errinf_dname(qstate, "at zone", iq->dp->name);
+                                       return error_response(qstate, id,
+                                               LDNS_RCODE_SERVFAIL);
+                               }
                                iq->num_target_queries += qs;
                                target_count_increase(iq, qs);
                        }