From f865c0b028dc7d5f7f2ee2f2ad3f6675e231a394 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 8 Jan 2018 16:19:37 +0100 Subject: [PATCH] Clarify where offset comes from --- pdns/dnsdist-lua-rules.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index 3ecafb7930..edfc9f24bd 100644 --- a/pdns/dnsdist-lua-rules.cc +++ b/pdns/dnsdist-lua-rules.cc @@ -761,7 +761,7 @@ public: return d_extrcode == 0; } - /* root label (1), type (2), class (2), ttl (4) + rdlen (2)*/ + // root label (1), type (2), class (2), ttl (4) + rdlen (2) if (optLen < 11) { return false; } @@ -772,6 +772,7 @@ public: } EDNS0Record edns0; static_assert(sizeof(EDNS0Record) == sizeof(uint32_t), "sizeof(EDNS0Record) must match sizeof(uint32_t) AKA RR TTL size"); + // copy out 4-byte "ttl" (really the EDNS0 record), after root label (1) + type (2) + class (2). memcpy(&edns0, optStart + 5, sizeof edns0); return d_extrcode == edns0.extRCode; -- 2.47.2