commit e0f1732: [Minor] Adopt Rspamd to flags in rdns reply

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Dec 1 19:42:05 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-12-01 19:10:29 +0000
URL: https://github.com/rspamd/rspamd/commit/e0f1732a975260140c235223d126e3e8a849f1e7

[Minor] Adopt Rspamd to flags in rdns reply

---
 src/lua/lua_dns.c          | 5 ++++-
 src/lua/lua_dns_resolver.c | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lua/lua_dns.c b/src/lua/lua_dns.c
index 0fdbe3f70..fe9951e89 100644
--- a/src/lua/lua_dns.c
+++ b/src/lua/lua_dns.c
@@ -166,9 +166,12 @@ lua_dns_callback (struct rdns_reply *reply, void *arg)
 	else {
 		lua_push_dns_reply (L, reply);
 
-		lua_pushboolean (L, reply->authenticated);
+		lua_pushboolean (L, reply->flags & RDNS_AUTH);
 		lua_setfield (L, -3, "authenticated");
 
+		lua_pushboolean (L, reply->flags & RDNS_TRUNCATED);
+		lua_setfield (L, -3, "truncated");
+
 		/* result 1 - not and error */
 		lua_pushboolean (L, true);
 		/* push table into stack, result 2 - results itself */
diff --git a/src/lua/lua_dns_resolver.c b/src/lua/lua_dns_resolver.c
index f43267dc6..b5ded396d 100644
--- a/src/lua/lua_dns_resolver.c
+++ b/src/lua/lua_dns_resolver.c
@@ -169,7 +169,7 @@ lua_dns_resolver_callback (struct rdns_reply *reply, gpointer arg)
 	 * 3 - entries | nil
 	 * 4 - error | nil
 	 * 5 - user_str
-	 * 6 - reply->authenticated
+	 * 6 - reply->flags & RDNS_AUTH
 	 * 7 - server
 	 */
 	if (reply->code != RDNS_RC_NOERROR) {
@@ -183,7 +183,7 @@ lua_dns_resolver_callback (struct rdns_reply *reply, gpointer arg)
 		lua_pushnil (L);
 	}
 
-	lua_pushboolean (L, reply->authenticated);
+	lua_pushboolean (L, reply->flags & RDNS_AUTH);
 
 	const gchar *servname = rdns_request_get_server (reply->request);
 


More information about the Commits mailing list