]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
hints.use_nodata(true) by default
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 4 Oct 2018 11:37:30 +0000 (13:37 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 4 Oct 2018 11:37:30 +0000 (13:37 +0200)
I believe that's what most users want; practical motivation:
https://forum.turris.cz/t/kresd-responds-to-hints-with-nxdomain-for-aaaa-requests/8353

NEWS
modules/hints/README.rst
modules/hints/hints.c

diff --git a/NEWS b/NEWS
index a29c77f8c73d69424475d54eb010605a708fc32f..875a9cd44c7c86f0cb64e1d58bd209f1b9b61f07 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,10 @@
 Knot Resolver 3.x.y (2018-mm-dd)
 ================================
 
+Incompatible changes
+--------------------
+- hints.use_nodata(true) by default; that's what most users want
+
 Improvements
 ------------
 - cache: handle out-of-space SIGBUS slightly better (#197)
index 91424396fae39fa7c04aa6c3935505e400ccf79a..a42d19ca04496af4a539862719effa1596e49b29 100644 (file)
@@ -109,5 +109,5 @@ Properties
   :param bool toggle: true if enabling NODATA synthesis, false if disabling
   :return: ``{ result: bool }``
 
-  If set to true, NODATA will be synthesised for matching hint name, but mismatching type (e.g. AAAA query when only A hint exists).
+  If set to true (the default), NODATA will be synthesised for matching hint name, but mismatching type (e.g. AAAA query when only A hint exists).
 
index 2667bee3c5822d948c22e1f19f068e1610d8dd9e..bad3345a87b804553a41c9841d643b249a3da35d 100644 (file)
@@ -40,7 +40,7 @@
 struct hints_data {
        struct kr_zonecut hints;
        struct kr_zonecut reverse_hints;
-       bool use_nodata;
+       bool use_nodata; /**< See hint_use_nodata() description, exposed via lua. */
 };
 
 /** Useful for returning from module properties. */
@@ -627,6 +627,7 @@ int hints_init(struct kr_module *module)
        }
        kr_zonecut_init(&data->hints, (const uint8_t *)(""), pool);
        kr_zonecut_init(&data->reverse_hints, (const uint8_t *)(""), pool);
+       data->use_nodata = true;
        module->data = data;
 
        return kr_ok();
@@ -675,7 +676,7 @@ struct kr_prop *hints_props(void)
            { &hint_add_hosts, "add_hosts", "Load a file with hosts-like formatting and add contents into hints.", },
            { &hint_root,   "root", "Replace root hints set (empty value to return current list).", },
            { &hint_root_file, "root_file", "Replace root hints set from a zonefile.", },
-           { &hint_use_nodata, "use_nodata", "Synthesise NODATA if name matches, but type doesn't.", },
+           { &hint_use_nodata, "use_nodata", "Synthesise NODATA if name matches, but type doesn't.  True by default.", },
            { NULL, NULL, NULL }
        };
        return prop_list;