commit 42bdaba: [Minor] Explain unobvious code

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Sep 21 18:28:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-09-21 19:24:35 +0100
URL: https://github.com/rspamd/rspamd/commit/42bdabaf651ec3a809c6e8cc88f8f1a21f8661c6 (HEAD -> master)

[Minor] Explain unobvious code

---
 src/libserver/spf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/libserver/spf.c b/src/libserver/spf.c
index 9af1dd112..7dd5ed31c 100644
--- a/src/libserver/spf.c
+++ b/src/libserver/spf.c
@@ -570,8 +570,11 @@ rspamd_spf_record_postprocess (struct spf_resolved *rec, struct rspamd_task *tas
 		if (cur_addr->flags & RSPAMD_SPF_FLAG_IPV6) {
 			guint64 t[3];
 
+			/*
+			 * Fill hash entry for ipv6 addr with 2 int64 from ipv6 address,
+			 * the remaining int64 has mech + mask
+			 */
 			memcpy (t, cur_addr->addr6, sizeof (guint64) * 2);
-			t[2] = 0;
 			t[2] = ((guint64) (cur_addr->mech)) << 48u;
 			t[2] |= cur_addr->m.dual.mask_v6;
 


More information about the Commits mailing list