public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, master, updated. a579d5e7fd1ef23523259fbcf2560e12846516d4
Date: Fri, 30 Oct 2026 11:47:15 +0000 (UTC)	[thread overview]
Message-ID: <4jGK8M2GScz2y3W@people01.haj.ipfire.org> (raw)

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


                 reply	other threads:[~2026-10-30 11:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4jGK8M2GScz2y3W@people01.haj.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox