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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f865c0b028dc7d5f7f2ee2f2ad3f6675e231a394;p=pdns Clarify where offset comes from --- diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index 3ecafb793..edfc9f24b 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;