]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- ipsecmod: Better logging for detecting a cycle when attaching the
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Wed, 24 Feb 2021 12:59:31 +0000 (13:59 +0100)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Wed, 24 Feb 2021 12:59:31 +0000 (13:59 +0100)
  A/AAAA subquery.

doc/Changelog
ipsecmod/ipsecmod.c

index 15420b3cda1f4a879d3301584cb2ef5e351a83b5..f8b0c9b0f67e88d6b75a1294d4ed45555dffc5f4 100644 (file)
@@ -1,6 +1,8 @@
 24 February 2021: George
        - Fix #384: (1) A minor request to improve the log (2) A minor bug in one
          log message.
+       - ipsecmod: Better logging for detecting a cycle when attaching the
+         A/AAAA subquery.
 
 23 February 2021: Wouter
        - Fix for zonemd, that domain-insecure zones work without dnssec.
index a1f40a512b8a0c883567367c369d6689db814eed..e443e882b5c8c569384270d2e9f14f563f5f4d01 100644 (file)
@@ -151,6 +151,17 @@ generate_request(struct module_qstate* qstate, int id, uint8_t* name,
        ask.qclass = qclass;
        ask.local_alias = NULL;
        log_query_info(VERB_ALGO, "ipsecmod: generate request", &ask);
+
+       /* Explicitly check for cycle before trying to attach. Will result in
+        * cleaner error message. The attach_sub code also checks for cycle but the
+        * message will be out of memory in both cases then. */
+       fptr_ok(fptr_whitelist_modenv_detect_cycle(qstate->env->detect_cycle));
+       if((*qstate->env->detect_cycle)(qstate, &ask,
+               (uint16_t)(BIT_RD|flags), 0, 0)) {
+               verbose(VERB_ALGO, "Could not generate request: cycle detected");
+               return 0;
+       }
+
        fptr_ok(fptr_whitelist_modenv_attach_sub(qstate->env->attach_sub));
        if(!(*qstate->env->attach_sub)(qstate, &ask,
                (uint16_t)(BIT_RD|flags), 0, 0, &newq)){