]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
dns64 nitpick: make the query flag "official"
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 7 Jul 2017 15:47:12 +0000 (17:47 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 7 Jul 2017 15:47:12 +0000 (17:47 +0200)
daemon/lua/kres-gen.lua
lib/rplan.h
modules/dns64/dns64.lua

index 513240019a797905f22b6c10c6faa7e67491178e..0346fe99dece866c29928616c1df7abc9e15d362 100644 (file)
@@ -165,7 +165,7 @@ struct kr_context {
        struct kr_zonecut root_hints;
        char _stub[];
 };
-struct query_flag {static const int NO_MINIMIZE = 1; static const int NO_THROTTLE = 2; static const int NO_IPV6 = 4; static const int NO_IPV4 = 8; static const int TCP = 16; static const int RESOLVED = 32; static const int AWAIT_IPV4 = 64; static const int AWAIT_IPV6 = 128; static const int AWAIT_CUT = 256; static const int SAFEMODE = 512; static const int CACHED = 1024; static const int NO_CACHE = 2048; static const int EXPIRING = 4096; static const int ALLOW_LOCAL = 8192; static const int DNSSEC_WANT = 16384; static const int DNSSEC_BOGUS = 32768; static const int DNSSEC_INSECURE = 65536; static const int STUB = 131072; static const int ALWAYS_CUT = 262144; static const int DNSSEC_WEXPAND = 524288; static const int PERMISSIVE = 1048576; static const int STRICT = 2097152; static const int BADCOOKIE_AGAIN = 4194304; static const int CNAME = 8388608; static const int REORDER_RR = 16777216; static const int TRACE = 33554432; static const int NO_0X20 = 67108864; static const int DNSSEC_NODS = 134217728; static const int DNSSEC_OPTOUT = 268435456; static const int NONAUTH = 536870912; static const int FORWARD = 1073741824;};
+struct query_flag {static const int NO_MINIMIZE = 1; static const int NO_THROTTLE = 2; static const int NO_IPV6 = 4; static const int NO_IPV4 = 8; static const int TCP = 16; static const int RESOLVED = 32; static const int AWAIT_IPV4 = 64; static const int AWAIT_IPV6 = 128; static const int AWAIT_CUT = 256; static const int SAFEMODE = 512; static const int CACHED = 1024; static const int NO_CACHE = 2048; static const int EXPIRING = 4096; static const int ALLOW_LOCAL = 8192; static const int DNSSEC_WANT = 16384; static const int DNSSEC_BOGUS = 32768; static const int DNSSEC_INSECURE = 65536; static const int STUB = 131072; static const int ALWAYS_CUT = 262144; static const int DNSSEC_WEXPAND = 524288; static const int PERMISSIVE = 1048576; static const int STRICT = 2097152; static const int BADCOOKIE_AGAIN = 4194304; static const int CNAME = 8388608; static const int REORDER_RR = 16777216; static const int TRACE = 33554432; static const int NO_0X20 = 67108864; static const int DNSSEC_NODS = 134217728; static const int DNSSEC_OPTOUT = 268435456; static const int NONAUTH = 536870912; static const int FORWARD = 1073741824; static const int DNS64_MARK = 2147483648;};
 int knot_dname_size(const knot_dname_t *);
 knot_dname_t *knot_dname_from_str(uint8_t *, const char *, size_t);
 char *knot_dname_to_str(char *, const knot_dname_t *, size_t);
index e66e4348e19f102f1ea74a5b966ecc5b3cc52052..92776bfca4bc51bedfeb857e5393aa55ad88df42 100644 (file)
@@ -58,7 +58,7 @@
        X(NONAUTH,         1 << 29) /**< Non-authoritative in-bailiwick records are enough.
                                     *   TODO: utilize this also outside cache. */ \
        X(FORWARD,         1 << 30) /**< Forward all queries to upstream; validate answers */ \
-                       /* 1 << 31       Used by ../modules/dns64/dns64.lua */
+       X(DNS64_MARK,      1u << 31) /**< Internal to ../modules/dns64/dns64.lua */
 
 /** Query flags */
 enum kr_query_flag {
index 9777aeb72db7c584081d0e7e7097b5e7799898ca..d0aade245bed37bff871d45e9d1ee20c9ca9aed1 100644 (file)
@@ -2,7 +2,6 @@
 local ffi = require('ffi')
 local bit = require('bit')
 local mod = {}
-local MARK_DNS64 = bit.lshift(1, 31)
 local addr_buf = ffi.new('char[16]')
 -- Config
 function mod.config (confstr)
@@ -23,7 +22,7 @@ mod.layer = {
                end
                -- Synthetic AAAA from marked A responses
                local answer = pkt:section(kres.section.ANSWER)
-               if bit.band(qry.flags, MARK_DNS64) ~= 0 then -- Marked request
+               if bit.band(qry.flags, kres.query.DNS64_MARK) ~= 0 then -- Marked request
                        local section = ffi.C.knot_pkt_section(pkt, kres.section.ANSWER)
                        for i = 1, section.count do
                                local orig = ffi.C.knot_pkt_rr(section, i - 1)
@@ -55,7 +54,7 @@ mod.layer = {
                        if pkt:qtype() == kres.type.AAAA and is_nodata and pkt:qname() == qry:name() and qry:final() then
                                local extraFlags = bit.bor(
                                        bit.band(qry.flags, kres.query.DNSSEC_WANT),
-                                       bit.bor(MARK_DNS64, kres.query.AWAIT_CUT)
+                                       bit.bor(kres.query.DNS64_MARK, kres.query.AWAIT_CUT)
                                        )
                                local next = req:push(pkt:qname(), kres.type.A, kres.class.IN, extraFlags, qry)
                        end