From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4jGN2Q12TQz2yVK for ; Fri, 30 Oct 2026 13:57:18 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4jGN2Q0p5yz2xP7 for ; Fri, 30 Oct 2026 13:57:18 +0000 (UTC) Received: from people01.haj.ipfire.org (people01.haj.ipfire.org [172.28.1.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "people01.haj.ipfire.org", Issuer "YE1" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4jGN2P5Jh8zvF for ; Fri, 30 Oct 2026 13:57:17 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1793368637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=xEqwb9LdwjNDUTkJJNSzOv+UPrNJcTUJZoxgKcorPI0=; b=SWQErjrEmy9FkstzfTtZgoExoX/zCB6OXtJKWbAZ0rxmR80VAKlf16uJifQ8swfnjXqR5+ vvWmKgZzuy2BpOAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1793368637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=xEqwb9LdwjNDUTkJJNSzOv+UPrNJcTUJZoxgKcorPI0=; b=h1tBiLcvit4TN4WSebTS2AjrezNfZwO6Bbf5y3xxq9d0HgI3uV4PPnVKF9EzgLFLTPRRKh tgSjRii9bTTI59M1F4a/b+cW/JWlIgGV8/1KXRV/CrkT1UX/rmmSIBJqKoIt/XSclqU7qq CLxWYgx+HZO5a5Nj1Bfy+KfiVnqtLzMUy20CbvZpf0URynz8uMIRLWG2eG/8ahoUXAffgU hYI2yqP5+FgG/lZsOU+rGnVSKptHDcqHSWQV4p2w6zT8UMaC1TuEGQ5vGxUGCzB4IMGYlT QvhE//d1qIlBAqfHdJpIQR8+MT4leO5bGr6V6xakOQD5kay++EGgaEukBl2vtA== Received: by people01.haj.ipfire.org (Postfix, from userid 1000) id 4jGN2P4rqlz2y3W; Fri, 30 Oct 2026 13:57:17 +0000 (UTC) To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. bf71d529c850e4c71f8199f2f3839ded7bbbec79 X-Git-Refname: refs/heads/next X-Git-Reftype: branch X-Git-Oldrev: ea036dc2eaa0173e706cfda78278f5a16ecfcb3c X-Git-Newrev: bf71d529c850e4c71f8199f2f3839ded7bbbec79 Message-Id: <4jGN2P4rqlz2y3W@people01.haj.ipfire.org> Date: Fri, 30 Oct 2026 13:57:17 +0000 (UTC) From: Michael Tremer Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: 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, next has been updated via bf71d529c850e4c71f8199f2f3839ded7bbbec79 (commit) via 6463138c6369f419608204e290e619e7abb2ee26 (commit) via f068a2f0ad85a5a3954129bf34b1ca26782c7480 (commit) via b34710a4e270d5c50114c81a8e4d181d1378a037 (commit) via 1ae1752ba2f2375768f81be8d9f92b37a1014cef (commit) via 185c0c13f929bd33d5200d10c857d9438b226558 (commit) via a579d5e7fd1ef23523259fbcf2560e12846516d4 (commit) from ea036dc2eaa0173e706cfda78278f5a16ecfcb3c (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 bf71d529c850e4c71f8199f2f3839ded7bbbec79 Merge: ea036dc2e 6463138c6 Author: Michael Tremer Date: Fri Oct 30 13:57:12 2026 +0000 Merge branch 'master' into next Signed-off-by: Michael Tremer ----------------------------------------------------------------------- Summary of changes: config/knot-resolver/config.lua | 36 ++++++++++++++++++++++++++++++++++-- config/knot-resolver/leases.lua | 16 ++++++++-------- 2 files changed, 42 insertions(+), 10 deletions(-) Difference in files: diff --git a/config/knot-resolver/config.lua b/config/knot-resolver/config.lua index 21ac063c7..9dcc7bd9d 100644 --- a/config/knot-resolver/config.lua +++ b/config/knot-resolver/config.lua @@ -29,6 +29,12 @@ local notify = require("cqueues.notify") -- Get access to the C interface local C = ffi.C +-- Declare functions that are not exposed by Knot Resolver +ffi.cdef[[ + int kr_rule_local_data_merge(const knot_rrset_t *rrs, kr_rule_tags_t tags, + kr_rule_opts_t opts); +]] + -- Helper function to load a key/value configuration file function config.load_settings(path) local settings = {} @@ -238,6 +244,26 @@ function config.load_forwarders(settings) policy.rule_forward_add(".", { dnssec=true, auth=false, tcp=tcp }, forwarders) end +-- Adds a forward record without creating the corresponding PTR record +-- (hints.set() always creates both) +local function add_forward_record(name, address) + -- Convert the address into wire format + local rdata = kres.str2ip(address) + if not rdata then + return + end + + -- Select the record type + local rtype = (#rdata == 16) and kres.type.AAAA or kres.type.A + + -- Create the RRset + local rr = kres.rrset(todname(name), rtype, kres.class.IN, 60) + rr:add_rdata(rdata, #rdata) + + -- Merge the record so that multiple addresses for the same name are kept + C.kr_rule_local_data_merge(rr, 0, C.KR_RULE_OPTS_DEFAULT) +end + -- Load any hosts function config.load_hosts() local path = "/var/ipfire/main/hosts" @@ -281,8 +307,14 @@ function config.load_hosts() hostname, address) end - -- Add the hint - hints.set(hint) + -- Add the hint (including the PTR record) + if ptr == "on" then + hints.set(hint) + + -- Otherwise only add the forward record + else + add_forward_record(hint:match("^(%S+)"), address) + end end end diff --git a/config/knot-resolver/leases.lua b/config/knot-resolver/leases.lua index d1c174103..6d259ee5c 100644 --- a/config/knot-resolver/leases.lua +++ b/config/knot-resolver/leases.lua @@ -156,16 +156,16 @@ function M.answer() end end - -- If the name exists, we send the answer (or NODATA if we have nothing - -- for this query type) - if exists then - answer = policy.ANSWER(answer, true) - - -- Otherwise we send NXDOMAIN - else - answer = policy.DENY + -- If the name is unknown, we do nothing so that the query can be answered + -- by another source (e.g. static hosts) or the upstream servers + if not exists then + return end + -- Otherwise we send the answer (or NODATA if we have nothing for this + -- query type) + answer = policy.ANSWER(answer, true) + -- Pass the state and request return answer(state, req) end hooks/post-receive -- IPFire 2.x development tree