From a28a06159b49af6dc90d97d0b3bbf82581081282 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 11 Aug 2022 21:36:13 +0100 Subject: [Minor] Ignore irrelevant DNS replies --- src/lua/lua_dns_resolver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lua/lua_dns_resolver.c b/src/lua/lua_dns_resolver.c index 8827cb1c1..cbdb06641 100644 --- a/src/lua/lua_dns_resolver.c +++ b/src/lua/lua_dns_resolver.c @@ -237,6 +237,11 @@ lua_push_dns_reply (lua_State *L, const struct rdns_reply *reply) LL_FOREACH (reply->entries, elt) { + if (!rdns_request_has_type(reply->request, elt->type)) { + /* Unrequested type has been returned, ignore it */ + continue; + } + switch (elt->type) { case RDNS_REQUEST_A: addr = rspamd_inet_address_new (AF_INET, &elt->content.a.addr); -- cgit v1.2.3