From: George Thessalonikefs Date: Wed, 24 Feb 2021 12:59:31 +0000 (+0100) Subject: - ipsecmod: Better logging for detecting a cycle when attaching the X-Git-Tag: release-1.13.2rc1~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f25bb4730888b34a96de82c7618db1062426881;p=thirdparty%2Funbound.git - ipsecmod: Better logging for detecting a cycle when attaching the A/AAAA subquery. --- diff --git a/doc/Changelog b/doc/Changelog index 15420b3cd..f8b0c9b0f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/ipsecmod/ipsecmod.c b/ipsecmod/ipsecmod.c index a1f40a512..e443e882b 100644 --- a/ipsecmod/ipsecmod.c +++ b/ipsecmod/ipsecmod.c @@ -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)){