]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
NO_0X20: add a new query flag
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 30 Jan 2017 14:58:00 +0000 (15:58 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 16 Feb 2017 10:19:45 +0000 (11:19 +0100)
daemon/lua/kres-gen.lua
lib/resolve.c
lib/rplan.h

index 8b3205bfd24a0c264233ce62cbc43fa12fd0c331..f69a33760273a4c0d52b81e5700fd6f6d3e89df1 100644 (file)
@@ -152,7 +152,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;};
+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;};
 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 5666758c76478c9970815991725b8af212633d27..72c5b7aab306ec0d2aa9301bc2a611a780f8ae60 100644 (file)
@@ -1058,8 +1058,9 @@ ns_election:
                return KR_STATE_PRODUCE;
        }
 
-       /* Randomize query case (if not in safemode) */
-       qry->secret = (qry->flags & QUERY_SAFEMODE) ? 0 : kr_rand_uint(UINT32_MAX);
+       /* Randomize query case (if not in safemode or turned off) */
+       qry->secret = (qry->flags & (QUERY_SAFEMODE | QUERY_NO_0X20))
+                       ? 0 : kr_rand_uint(UINT32_MAX);
        knot_dname_t *qname_raw = (knot_dname_t *)knot_pkt_qname(packet);
        randomized_qname_case(qname_raw, qry->secret);
 
index d3bf90012fbf377f3aaeaaf0e620a6821ec95c1e..92f94d09e20c80c93e17001d75f568aa1487f72b 100644 (file)
@@ -34,7 +34,7 @@
        X(AWAIT_IPV4,      1 << 6) /**< Query is waiting for A address. */ \
        X(AWAIT_IPV6,      1 << 7) /**< Query is waiting for AAAA address. */ \
        X(AWAIT_CUT,       1 << 8) /**< Query is waiting for zone cut lookup */ \
-       X(SAFEMODE,        1 << 9) /**< Don't use fancy stuff (EDNS...) */ \
+       X(SAFEMODE,        1 << 9) /**< Don't use fancy stuff (EDNS, 0x20, ...) */ \
        X(CACHED,          1 << 10) /**< Query response is cached. */ \
        X(NO_CACHE,        1 << 11) /**< No cache for lookup; exception: finding NSs and subqueries. */ \
        X(EXPIRING,        1 << 12) /**< Query response is cached, but expiring. */ \
@@ -51,7 +51,8 @@
        X(BADCOOKIE_AGAIN, 1 << 22) /**< Query again because bad cookie returned. */ \
        X(CNAME,           1 << 23) /**< Query response contains CNAME in answer section. */ \
        X(REORDER_RR,      1 << 24) /**< Reorder cached RRs. */ \
-       X(TRACE,           1 << 25) /**< Log answer with kr_verbose_log(), unless -DNDEBUG. */
+       X(TRACE,           1 << 25) /**< Log answer with kr_verbose_log(), unless -DNDEBUG. */ \
+       X(NO_0X20,         1 << 26) /**< Disable query case randomization . */ \
                        /* 1 << 31       Used by ../modules/dns64/dns64.lua */
 
 /** Query flags */