]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/hints: change default TTL to 5s, add NEWS
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 17 Jan 2019 13:58:35 +0000 (14:58 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 29 Jan 2019 14:08:39 +0000 (15:08 +0100)
0 was unreasonable.  Even if hints are meant for "close" devices,
they will commonly be e.g. behind WiFi, and it seems unreasonable to
expect changes faster than after a couple seconds anyway.

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

diff --git a/NEWS b/NEWS
index e4899599e89af33bf200719022d75e8b461c6d46..fe1300745941d830b9624397149b3cc840bcb527 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ Bugfixes
   that were loaded as unmanaged trust anchors (!753)
 - trust_anchors.add(): include these TAs in .summary() (!753)
 
+Improvements
+------------
+- hints module: allow configuring the TTL and change default from 0 to 5s
+
 
 Knot Resolver 3.2.1 (2019-01-10)
 ================================
index 3630268a4771122f38fc65b685cbca765fc25d18..bbabe4f8bfb35858565177a3d69eebcf6173a2ab 100644 (file)
@@ -117,5 +117,4 @@ Properties
   :return: the TTL setting
 
   This function allows to read and write the TTL value used for records generated by the hints module.
-  The default is zero.
 
index a2c90d0a1d0475779df00fdc09a58decfd75752e..ecd663c4ebe98fbf9a1c263f36fef5c74bc65d15 100644 (file)
@@ -46,6 +46,7 @@ struct hints_data {
        bool use_nodata; /**< See hint_use_nodata() description, exposed via lua. */
        uint32_t ttl;    /**< TTL used for the hints, exposed via lua. */
 };
+static const uint32_t HINTS_TTL_DEFAULT = 5;
 
 /** Useful for returning from module properties. */
 static char * bool2jsonstr(bool val)
@@ -638,7 +639,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;
-       data->ttl = 0;
+       data->ttl = HINTS_TTL_DEFAULT;
        module->data = data;
 
        return kr_ok();