]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #1193: log-servfail fails to log host SERVFAIL responses in
authorYorgos Thessalonikefs <yorgos@nlnetlabs.nl>
Mon, 2 Dec 2024 11:28:11 +0000 (12:28 +0100)
committerYorgos Thessalonikefs <yorgos@nlnetlabs.nl>
Mon, 2 Dec 2024 11:28:11 +0000 (12:28 +0100)
  Unbound 1.19.2 on Ubuntu 24.04.1 LTS, by not considering cached
  failures when trying to reply with expired data.

services/mesh.c

index 5b9a02ae48a9590d4bef49b8d974c8dbe3acafe7..18a53b4a5947d59c240e1c9a77cdcc4c10d408ec 100644 (file)
@@ -2203,8 +2203,13 @@ mesh_serve_expired_callback(void* arg)
                        qstate->serve_expired_data->get_cached_answer));
                msg = (*qstate->serve_expired_data->get_cached_answer)(qstate,
                        lookup_qinfo, &is_expired);
-               if(!msg)
+               if(!msg || (FLAGS_GET_RCODE(msg->rep->flags) != LDNS_RCODE_NOERROR
+                       && FLAGS_GET_RCODE(msg->rep->flags) != LDNS_RCODE_NXDOMAIN
+                       && FLAGS_GET_RCODE(msg->rep->flags) != LDNS_RCODE_YXDOMAIN)) {
+                       /* We don't care for cached failure answers at this
+                        * stage. */
                        return;
+               }
                /* Reset these in case we pass a second time from here. */
                encode_rep = msg->rep;
                memset(&actinfo, 0, sizeof(actinfo));