From: Chris Hofstaedtler Date: Mon, 8 Jan 2018 15:19:37 +0000 (+0100) Subject: Clarify where offset comes from X-Git-Tag: dnsdist-1.3.0~160^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6147%2Fhead;p=thirdparty%2Fpdns.git Clarify where offset comes from --- 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;