commit a28a061: [Minor] Ignore irrelevant DNS replies

Vsevolod Stakhov vsevolod at rspamd.com
Thu Aug 11 20:42:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-08-11 21:36:13 +0100
URL: https://github.com/rspamd/rspamd/commit/a28a06159b49af6dc90d97d0b3bbf82581081282

[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);


More information about the Commits mailing list