* [git.ipfire.org] IPFire 2.x development tree branch, master, updated. a579d5e7fd1ef23523259fbcf2560e12846516d4
@ 2026-10-30 11:47 Michael Tremer
0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2026-10-30 11:47 UTC (permalink / raw)
To: ipfire-scm
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, master has been updated
via a579d5e7fd1ef23523259fbcf2560e12846516d4 (commit)
from 7d93a465862e5b87d0de299053f27dc1e79f77b6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a579d5e7fd1ef23523259fbcf2560e12846516d4
Author: Michael Tremer <michael.tremer@ipfire.org>
Date: Fri Oct 30 11:41:23 2026 +0000
knot-resolver: Load the hints module again to resolve static hosts
The hints module is not loaded by default in Knot Resolver 6, and the
YAML migration dropped the line that loaded it. As a result, hosts from
the hosts page did not resolve.
Load the module again, clear any previous hints and wrap hints.set() in a
rules transaction as hints.set() requires one.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
(cherry picked from commit bf5b42f81313faf3f365768000e412c626cfe218)
-----------------------------------------------------------------------
Summary of changes:
config/knot-resolver/config.lua | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Difference in files:
diff --git a/config/knot-resolver/config.lua b/config/knot-resolver/config.lua
index e640c593f..21ac063c7 100644
--- a/config/knot-resolver/config.lua
+++ b/config/knot-resolver/config.lua
@@ -245,6 +245,12 @@ function config.load_hosts()
-- Log action
log_debug(ffi.C.LOG_GRP_HINT, string.format("Loading hosts from %s", path))
+ -- Load the hints module (it is not loaded by default in Knot Resolver 6)
+ modules.load("hints > iterate")
+
+ -- Clear any previously registered hints
+ hints.config()
+
-- Load /etc/hosts
hints.add_hosts("/etc/hosts")
@@ -254,6 +260,12 @@ function config.load_hosts()
-- Open the file
local f = csv.open(path, { separator = "," })
+ -- Start a new transaction
+ -- This is needed to make hints.set() not crash the entire process as it
+ -- calls kr_rule_local_data_merge() which requires to be called inside
+ -- a transaction.
+ ffi.C.kr_rules_commit(false)
+
for fields in f:lines() do
local status, address, hostname, domainname, ptr = unpack(fields)
@@ -273,6 +285,9 @@ function config.load_hosts()
hints.set(hint)
end
end
+
+ -- Commit the transaction
+ ffi.C.kr_rules_commit(true)
end
local GOOGLE_TLDS = {
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-30 11:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 11:47 [git.ipfire.org] IPFire 2.x development tree branch, master, updated. a579d5e7fd1ef23523259fbcf2560e12846516d4 Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox