From patchwork Tue Apr 2 13:09:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1918812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=GbD8QFlO; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=C3NzAyME; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=evFukSRQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V87YM2Lvlz1yZ4 for ; Wed, 3 Apr 2024 00:11:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xQRB5lULpom55ob6Yk2NTueuVfwdSNpxUcWrV7xpezk=; b=GbD8QFlOKZV7t5 oQxlToQVrDD7KcnB98tMaZC8T6Bc8G/QglzKB474TKEHJYxjiT/3VM0az82BHG4y1dMRfFO4dTYkE OfQFT8Hx9Cv6Kr3vPwVvzaC/RxkB4/cUGrI2Bqams/77qQHPV7Nmws2UdXb86dIie1blICynFHTON X71YItdLdC7ZsM/M4kX6itIUMZvv0tmKmFmS01XlOYHxkgphHf1hhCmAx4ABGp8uXuhI+LBMZkvrv HWuDaCHTKsFnAnpn8ibVaT3Qnevixv+58JGdxTyAFTwERwT5iLON52wn6bEvgUTIx94tAhRduqkkh owcAdlAGdjiowN7timuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtS-0000000BGTE-2tQg; Tue, 02 Apr 2024 13:09:38 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtJ-0000000BGOk-1G1u for openwrt-devel@bombadil.infradead.org; Tue, 02 Apr 2024 13:09:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=SFkaH1lY1I7FNwh2cjw6ExW+UnS8a0ROCDxE2G7x2dM=; b=C3NzAyME9ij3LQbnAzQl1Y5mBw CNkdHIc1yAgYBMnwb9FWYn0ZRGL6VW95Z1ygAMggqxn1JahY+TmauTLEyCBh6JUNZ4AtCdWPcdlp6 uURk/GNUi9Rkr9BqtwbgMFlUjYuKtp4750pDvjsNmnnPMf/3FJvjy5DSMJKkcCuclLJPo5tiik3PR t68biQczvXDgGOC5KQ0eru5WUkjKFuK7Bkz1ah4k3Hv3z4te96JqJqtVWbHwAfRx//pnqSigTAOwC 7BjxojirMdrzu5H0pAtFftt5PM08+Vh9eI9EfZFdK314bI0+I/OSmf8n2ru6Bp8ziT7Jqzqd/jBNv lSKXk9vg==; Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtD-00000003e5d-2pqA for openwrt-devel@lists.openwrt.org; Tue, 02 Apr 2024 13:09:27 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-513d4559fb4so6369290e87.3 for ; Tue, 02 Apr 2024 06:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712063361; x=1712668161; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:sender:from:to:cc:subject:date:message-id:reply-to; bh=SFkaH1lY1I7FNwh2cjw6ExW+UnS8a0ROCDxE2G7x2dM=; b=evFukSRQKrMmDtDyHpeVUeX4lfJP/ABiYzVvSwTnsb/IXNHM4pl30d2GA0LQUJxT1z KyHpLSQYjfSj86D392Pdii/baF6BwvOu0jwaYUOZrM3gpM4WtvfivyBTMkt5njBwG+WX wwZOF6dKMUVdXhY+f6y+LZg3JCO2Xt1ttp3ENohK+n9ziyHA6GqcDOR1BTGpdV2vBvKY oY5Z+zabcVEZp6SYumiCBsqQvZfjApSYf7Q/bUO31MOmFB3JcIf5XD8rmUDjS/eMrQ4H Or1TIfZ1F79rRP071HLNCHyXI9z2eMwEninzhqiGG67dqGKzqLxoXCERCra9VMiwd8sy Kkgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712063361; x=1712668161; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SFkaH1lY1I7FNwh2cjw6ExW+UnS8a0ROCDxE2G7x2dM=; b=X03R7cw50Y5bfKuvOiX+yzpJvq3TdIrYdCen3tYgr4eOeNo+ho9nOzTbnB2EZ7tmyh 782TbyIWm8cMttYzKmez7XA+rayV6o8OObSqCdsnga8DE1gQ9wvY6SgP+UGIqYO+dt1o owF9rQHjeBb9tj2NpqyBQL5LME5BHxrPjAsPuGw7CjgLVkOi278Y+UA4vC0nsxgtv/gA +UZDzlVYebNs4p5jaP/OUYho7dWzaZerj7HYI09wI8tk4Kohz8wfIumrMSRqu3HE2wUk rNkFrhOWuPvX9csk6w6FvLfdXFLLXB+dGCq62dhjV/yL5PMwdxVH1nFxWu/EGYueuQmL 2+uA== X-Gm-Message-State: AOJu0YwSwq0G38oaZrNFk1JlLA9HqyT1TIFW/qsaAS1L2Y/gxaE3NJAJ 10xYbZgUYsACrIBM+IVQP7SoTAarrt7j5pYw960p9LSHkmWWGiLtVqiPNLuc X-Google-Smtp-Source: AGHT+IEpRUbd1pzdRZqVYN1CDS5ANh797CiseEYit1wEh91DLoDhfv433gch/chTETUkUVcIuCVJ4A== X-Received: by 2002:ac2:4d07:0:b0:515:bc26:24d8 with SMTP id r7-20020ac24d07000000b00515bc2624d8mr9448482lfi.66.1712063360542; Tue, 02 Apr 2024 06:09:20 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id m15-20020a056512358f00b005159fa03501sm1704109lfr.302.2024.04.02.06.09.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:09:20 -0700 (PDT) From: Paul Donald To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/5] dnsmasq: add handling of `filter-rr` to init script Date: Tue, 2 Apr 2024 15:09:15 +0200 Message-ID: <20240402130919.58881-1-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_140924_011820_9D730C50 X-CRM114-Status: UNSURE ( 7.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: dnsmasq v2.90 introduced `--filter-rr=[,...]`. uci config usage: config dnsmasq ... option filter_rr 'AAAA,CNAME,NXDOMAIN,SRV,...' Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [newtwen+github(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:131 listed in] [list.dnswl.org] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org dnsmasq v2.90 introduced `--filter-rr=[,...]`. uci config usage: config dnsmasq ... option filter_rr 'AAAA,CNAME,NXDOMAIN,SRV,...' The dnsmasq instance internally builds a linked list of RR to filter from the individually supplied parameters, so it's harmless to provide synonyms: ... --filter-A --filter-rr=A ... See https://forum.openwrt.org/t/resolving-query-type-65-to-local-address-for-ios-clients-in-dnsmasq/179504/23 Tested on: 23.05.2 Signed-off-by: Paul Donald Tested-by: Vladimir Kochkovski --- package/network/services/dnsmasq/files/dnsmasq.init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 138a913f87..15cf194673 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -973,8 +973,10 @@ dnsmasq_start() append_bool "$cfg" rapidcommit "--dhcp-rapid-commit" append_bool "$cfg" scriptarp "--script-arp" + # deprecate or remove filter-X in favor of filter-rr? append_bool "$cfg" filter_aaaa "--filter-AAAA" append_bool "$cfg" filter_a "--filter-A" + append_parm "$cfg" filter_rr "--filter-rr" append_parm "$cfg" logfacility "--log-facility" config_get logfacility "$cfg" "logfacility" From patchwork Tue Apr 2 13:09:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1918809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=YDhmEyYo; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=i7Z3ZOOA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V87YK4t0Pz1yZ4 for ; Wed, 3 Apr 2024 00:11:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tahf/BoszYo63vMCebjohrdm1ZKuAIb73I4uvdQ7D9w=; b=YDhmEyYo/xoTu8 nUANNVkNzIbYMYqRm+2dUEonN1pIzGtmi9k//7pbCm4gzAH+D9r+gpfn+1qydBCx2eLbQTPIfO3VB /kGQDLZqT4ohp1pLEaAnZNMPBeCw2dfeiwO7TrASSS596sH/7WIYxbGTkjHRkucuaoqSl2tgHenKG vOe6slwTGzhoQMwiysC2zN3pT/wsoq3ys7ak9iCEHEDvqj5p2IPoy9mkK6UdNy+WNWMCJXce0kl7V F47eT9k1pt3SadLgDMPiEVqPim0b3PAQnYV+m8ld5DXRk3erpp5Cxhhmidemzaht2QMbxGhw1hKql 2a6sEdMY6YCRMiXpYLGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtU-0000000BGUR-3pEn; Tue, 02 Apr 2024 13:09:40 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtD-0000000BGLH-0hKb for openwrt-devel@lists.openwrt.org; Tue, 02 Apr 2024 13:09:28 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-515c198e835so5908139e87.3 for ; Tue, 02 Apr 2024 06:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712063361; x=1712668161; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=EVEFa8SVvZRmYH0/UVoMDNFY8o43iPHJ9rmYpVQ4N7U=; b=i7Z3ZOOAeVMU1MYzqnRjT6brSJv//fOrKAc8ukvBsiJ3D/v5k8LN0JSQXJToINFGN2 9K6uHwahv87DAr5PTCecjA75+A0SfM1gA0MDVOxivHetT23kBHtGui++iTJ8Fuwjw+xN cDX6qcagnw8mSo7+yB/aZe/lKQ1Sx70rkoNQkEoSV/j6P6OlFW3LmNQ4EieBD3wP9nWe ej/4NSPWpS5Za6L5xayayQTfSywz2lFdJS/i0jrG13UrkNMurbOk50S2wcM2xbv+Is10 ooWA49m6VMwpmeHMwJ83IO+EV8cLkxX2bOQDtZJVic9E8tC0bV3weQB6saMBOIyRaMcX 0Xbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712063361; x=1712668161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=EVEFa8SVvZRmYH0/UVoMDNFY8o43iPHJ9rmYpVQ4N7U=; b=sWneknEdYz//rim7MXqyxCUGXL3FzcoWYSQGSEu8lIO/zyl1c6OE6dj0575uVfYa2M Rcx0XnPZzGxwVXxvLRG5Zz9iSbOr8wP7950e6LeDe9iLOinq+y7YIWQiInBk5NLtYuLm 63NVJFYhSq9w2O5a1ZJNdIUZlWayJ8WIM4vTDCDFJsT94NZErEEjE3bz6PGOZja8Sgxf Vgiys2NFCMdNMKPss8sib+whfZEWQTzEDvgAQAftpRD/2SBtTqwjvwZFndG8uTA7xNDR m836SfyX7y3ote1qIciUuFJe+o/AkQmUvUPKn8RqMT/YDDyoWS02WoxyJomSm04zOdmz eeFA== X-Gm-Message-State: AOJu0Yw9kDigDvFTKflrZFVFP3QRPLDOikVpcRTevx0mdZCB+4ZZ8qrr p7VfsXYvQrcDugb5REsyhISFbjigJndYtrFhe5hagToyfD93xXMnyUofl3lQ X-Google-Smtp-Source: AGHT+IG0qbN+2y5RXnTsKHwIROsSCibU7wyPbZArCy3UiULyPpB6coKw4wi9t/gPGCBu7aB26PQiIA== X-Received: by 2002:a05:6512:480c:b0:516:1a1e:5640 with SMTP id eo12-20020a056512480c00b005161a1e5640mr6105820lfb.33.1712063360938; Tue, 02 Apr 2024 06:09:20 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id m15-20020a056512358f00b005159fa03501sm1704109lfr.302.2024.04.02.06.09.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:09:20 -0700 (PDT) From: Paul Donald To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/5] dnsmasq: add handling of `cache-rr` to init script Date: Tue, 2 Apr 2024 15:09:16 +0200 Message-ID: <20240402130919.58881-2-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402130919.58881-1-newtwen+github@gmail.com> References: <20240402130919.58881-1-newtwen+github@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_060927_118158_04F02F04 X-CRM114-Status: UNSURE ( 7.44 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: dnsmasq v2.90 introduced `--cache-rr=[,...]`. uci config usage: config dnsmasq ... option cache_rr 'AAAA,CNAME,NXDOMAIN,SRV,...' Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:133 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [newtwen+github(at)gmail.com] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org dnsmasq v2.90 introduced `--cache-rr=[,...]`. uci config usage: config dnsmasq ... option cache_rr 'AAAA,CNAME,NXDOMAIN,SRV,...' The dnsmasq instance internally builds a linked list of RR to cache from the individually supplied parameters, so it's allowed to provide multiples: ... --cache-rr=AAAA --cache-rr=A ... See https://forum.openwrt.org/t/resolving-query-type-65-to-local-address-for-ios-clients-in-dnsmasq/179504 Tested on: 23.05.2 Signed-off-by: Paul Donald --- package/network/services/dnsmasq/files/dnsmasq.init | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 15cf194673..9bb334f816 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -977,6 +977,7 @@ dnsmasq_start() append_bool "$cfg" filter_aaaa "--filter-AAAA" append_bool "$cfg" filter_a "--filter-A" append_parm "$cfg" filter_rr "--filter-rr" + append_parm "$cfg" cache_rr "--cache-rr" append_parm "$cfg" logfacility "--log-facility" config_get logfacility "$cfg" "logfacility" From patchwork Tue Apr 2 13:09:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1918811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1jBS646v; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=J5Hm6nMM; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=j2HVJcTB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V87YJ6FLrz1yZ3 for ; Wed, 3 Apr 2024 00:11:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9AN0Vi6VjhhkUQHGy2iGU1l9YU3M5m4084QAwvPidIs=; b=1jBS646vxwiLf4 Pw2PD1YWS7kcVR8Ne8fQ8E2fIZG0mSL6FdGmUglOLY8koYkILDl/DhzgJYh4PO8uVDNJ1E54e8CEU 1uFMmne68j5uWukbBLt42XjICZhGbfJOI6Ggl4d4CtQvHeLfc/iaBuKT8V/A6xxtJtnWL2X22vyQP l0LlR8F9dIVdhiVxVRMozoZ7Y2S+hssWu1Ndv11rfElOllCo41LPyOHEO/9UJ/AKHdrqX1nPpxsZg pGNB/uhr5UfA9BMOcaZB0kZvhwBWCdJ+nPGBk4nSyGYAHUWPuORXWYbUp4eRQoQbJ4Zp/yuYyYRqY 2B7j+T54b8GBLdydDs4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtL-0000000BGQ1-44xt; Tue, 02 Apr 2024 13:09:32 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtJ-0000000BGOl-1Eib for openwrt-devel@bombadil.infradead.org; Tue, 02 Apr 2024 13:09:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description; bh=t4PAMFsnYdqLhY3133/R/aTcTMYY6xWqHb5MD0Dt37g=; b=J5Hm6nMMUkyLFkvqE6b+9pU4ol k4rd4j2+4K1JaGt7StZ/5ghBRpEyiax8KjQTz55P89ZgVMIFj9VTmNG/XcJZhi2+l0HdjpZ3kPU0W Oz+4PCFD/qM+OBv8xdHLjmepuidFu7kxRgHsbqpBFq5mrXWhOyQ+DHh24moY6BNFx/qu/Rsk/xQmo VM6lRz/tElytfvv/xXN7QWJJ6GZImKxFVGGznm4XeK/C9pbc0ZfJi1ztpiYX7bHrSOJmtmvuFqMrA C+9QnZUx+n5T2+KF75FarAwHtL2va45/QCtuOjTTYnhPbGRXAdmiiIRIASEN9zYilsEoxLNwrAMDQ jH6BbGCA==; Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtE-00000003e5h-1isR for openwrt-devel@lists.openwrt.org; Tue, 02 Apr 2024 13:09:27 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-515b3077d09so5575083e87.1 for ; Tue, 02 Apr 2024 06:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712063362; x=1712668162; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=t4PAMFsnYdqLhY3133/R/aTcTMYY6xWqHb5MD0Dt37g=; b=j2HVJcTBqXo+SriIN9HUoogOVD4O3WMq/toM/EzPdbRnWDi0MYtxunRZYRLdmaX3FR maFPkkHn/T3CeaYOz8O8h/TCgLxqvDUZl/SxJ/yEB46iaE8eqjfXaTJ8pJmUSX4N5aAO /xQla8dZ4vRR0SH/qaFQNkaHAw48UvU66tjzNTrLPd494x/8tauC5CnyGNyZ1/uLW5Qh YoItredy4CrERj9nMprSrAvaDZ0VA0dUpHrM+82NGJoI3fmaHHY42JFrQsMPaAlyMWZD 3Sb/2NMMHsuJVWmJ/joh13bpWwVSl9cTn3+QkscPzKKStKGUzP2tNTu+SmHwA5DFb2F3 BuMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712063362; x=1712668162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=t4PAMFsnYdqLhY3133/R/aTcTMYY6xWqHb5MD0Dt37g=; b=vqraUYiehZA9633Kz1j1fQVMD5Ui8s4kSQH4k4ulL/L5h3QtbnyOgOLIc1GeZ6IRvb BpQp6+IEZEuErneMv0a0x7p8U+DF5E4udogJTCN0D6UNOgsUbas3vxwa8ca9jaLTm1KX WrYqjk829gaYzhBUho2sXzES+vo0i7EvU3L0ZKe7ox2jgWTyJLua9mxKtJ8IBJ8FOAiX 5IeHrF42MjZLzrlFTu69yufWR2Ih8fYaRwqrkzxci/06DBw8+K2useAGZabRA2eY+hc4 j1/gu723dfOZ7hG7ImHcYn+TWcnbBR1SbZ/oQIfQbYZPWoKv9yCD3h5kNlyEJn3XBKbU Frag== X-Gm-Message-State: AOJu0Yyp2RVcugIOAAHFl8oULJxwkV7UUhHv5xOcaOYt8QndvGcBfSeo KqimWjq8b4XRj1CQu7nLHDkk+Vmq5n+OnAKYKgSd3UUlFT+usfqziBWlP+81 X-Google-Smtp-Source: AGHT+IFVB0G7eUNdkBGPlyVrlrmsTHonZ/jGOOdMtRth30lmWv3IDypC1/sbV/YermEdDxNx/vi0Gg== X-Received: by 2002:a05:6512:3e12:b0:515:d19b:babc with SMTP id i18-20020a0565123e1200b00515d19bbabcmr12310759lfv.68.1712063362085; Tue, 02 Apr 2024 06:09:22 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id m15-20020a056512358f00b005159fa03501sm1704109lfr.302.2024.04.02.06.09.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:09:21 -0700 (PDT) From: Paul Donald To: openwrt-devel@lists.openwrt.org Subject: [PATCH 3/5] dnsmasq: add 'extraconftext' parameter Date: Tue, 2 Apr 2024 15:09:17 +0200 Message-ID: <20240402130919.58881-3-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402130919.58881-1-newtwen+github@gmail.com> References: <20240402130919.58881-1-newtwen+github@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_140924_875512_EC892CD4 X-CRM114-Status: GOOD ( 10.04 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Users can now freely add new dnsmasq parameters (i.e. a whole config) via extraconf. This means users can add their own parameters without changes to init or GUI. Co-opted the default of confdir also to include the instance name. This way each instance gets its own .d directory (and separate instances do not all inherit the same 'extraconftext'). Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:133 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [newtwen+github(at)gmail.com] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Users can now freely add new dnsmasq parameters (i.e. a whole config) via extraconf. This means users can add their own parameters without changes to init or GUI. Co-opted the default of confdir also to include the instance name. This way each instance gets its own .d directory (and separate instances do not all inherit the same 'extraconftext'). See https://forum.openwrt.org/t/add-dnsmasq-custom-options-field-in-luci-gui/193184 Tested on: 23.05.3, 22.03.6 Signed-off-by: Paul Donald --- package/network/services/dnsmasq/files/dnsmasq.init | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 9bb334f816..9b98bbb015 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -12,6 +12,7 @@ ADD_WAN_FQDN=0 ADD_LOCAL_FQDN="" BASECONFIGFILE="/var/etc/dnsmasq.conf" +EXTRACONFFILE="extraconfig.conf" BASEHOSTFILE="/tmp/hosts/dhcp" TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf" TIMEVALIDFILE="/var/state/dnsmasqsec" @@ -1118,14 +1119,19 @@ dnsmasq_start() xappend "--dhcp-broadcast=tag:needs-broadcast" - config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq.d" + # Create a dnsmasq.d dir for each instance + config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq${cfg:+.$cfg}.d" xappend "--conf-dir=$dnsmasqconfdir" dnsmasqconfdir="${dnsmasqconfdir%%,*}" - [ ! -d "$dnsmasqconfdir" ] && mkdir -p $dnsmasqconfdir + [ ! -d "$dnsmasqconfdir" ] && mkdir -p "$dnsmasqconfdir" xappend "--user=dnsmasq" xappend "--group=dnsmasq" echo >> $CONFIGFILE_TMP + # EXTRACONFFILE allows new dnsmasq parameters before they are natively handled in this init file + config_get extraconftext "$cfg" extraconftext + echo -e "$extraconftext" > "$dnsmasqconfdir"/"$EXTRACONFFILE" + config_get_bool enable_tftp "$cfg" enable_tftp 0 [ "$enable_tftp" -gt 0 ] && { config_get tftp_root "$cfg" tftp_root From patchwork Tue Apr 2 13:09:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1918810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0Y9I7glp; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=bVSjAO74; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Uk/dOQEp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V87YL014Gz1yZB for ; Wed, 3 Apr 2024 00:11:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BdsvbQiQuU93dOUaLZ0a0ksRlgBpPuYCvq+ZryzqPrY=; b=0Y9I7glp/CPLej COCnsbYhAs3k4JYJwyUDzqW/QNswe2ddBgRLGxZ22HntrbZK4t2rMIinNAjTV5Ig+vPCybSmAkwXh 8gyPR/8nQTYdIgVqUAxYIN5iFDfE9LINZ7m8Zm/ba2KAc415z2u9XTD+v3dm/UgL1TjuxDblqTtDi 68di1Ulq4+jO0Sh8Ss7ORYkJMlbhWnVgpIJKFGq/g2UEECQ9iYRPrzt2I/ZrI/pNn9TIciyRoZKAO TEf5Mv2yJr1qewPo4nYxQmMgItyiv8ChiVr6jcboR1e8oJhEa8YIwBnVIUjIwbnQDSeuX57cSeNMP nD1iRIbEDA4G3bkJSEMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtP-0000000BGSC-0B2i; Tue, 02 Apr 2024 13:09:35 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtJ-0000000BGOj-1CJl for openwrt-devel@bombadil.infradead.org; Tue, 02 Apr 2024 13:09:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description; bh=fFPMXbEcjmj2EYDOiyKqS78bZ6HXZ/tB80wfxvpsl8Q=; b=bVSjAO74XQfjqP9f17BtoD9YKX 7AKp0J8xdWqI/hDbfcq7DfwBdJd0NRWeVDxwFYPc4Y3H899Mg2sI+4Nl2lJVFAhi15nosfpIvSUOp HQ0yi89jcn67yMQknpKzJe7oX83ilmppqXr72WXy+DNY4Gzcf/K9x/ZwXUnOK3F6pkzSpskAl9Kbl yMK5mp5QxgnsqazZ9pqqKO0Eq2XAh9N4OyfCblbjfaWkUJ5jSU4wAco6Cqnde0OC7Qg2kCGgjwaDC SBIuhLVHDQa3fZlwu74tL27/IW6Rz4xTJ/9v5h1sL+S655MA8AgizxSAquirkYxes6YZ8yHIGt0t0 p5wBpD+A==; Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtE-00000003e62-1j36 for openwrt-devel@lists.openwrt.org; Tue, 02 Apr 2024 13:09:27 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5157af37806so5598439e87.0 for ; Tue, 02 Apr 2024 06:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712063363; x=1712668163; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=fFPMXbEcjmj2EYDOiyKqS78bZ6HXZ/tB80wfxvpsl8Q=; b=Uk/dOQEpRiJvF1HC2o8rZku9UnYqhpJN+NIy+AWDk7+ENBEPlN0M4AXWQ3D5r1IP+1 VQz+t/98aV/wFkXSFrJ1JNt5Dk3tft3ugaATDBjuSg91YeyJYeuEjDauhi5HDqOIsWTm vNRAAWdvDhkDSClEMmJ3BSIpIobkAzVOgaEC1J+Ri7xnB3wACtOZj6/Pd9skCDcNVNJD OnQPyDP/rSQNg3fe0eO5ADTDSs5SY7DPoZXFmADmsllDZ+YIH066FCR6GQkVL3n5AoOk 4osuoIEqGdCWFs3/rKgLErn7gO8zg4cVT91OgOnVMnrO8d4NNfS/Yrgs+VGhCeZaEqeb qoeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712063363; x=1712668163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=fFPMXbEcjmj2EYDOiyKqS78bZ6HXZ/tB80wfxvpsl8Q=; b=v+Q07ytw3bcBUbDmx0eLDN/uMtecAe7/nN/E1Yc6+klbYF/FJAPB7f08thVOa2j3Tj RjHCI+KEthVx+fNmYtp59cVG5m/Cf2WcnogNrMmxu/1fbJDduOxV5B6LE8xTQF/ho8Jm nHqaI36K2hh90DAbmc8oqBurDMKRU65ziobQgjmnZh9oO1rvnl7iRHZEvgyI1vVlKPJU 2SZQU+8ILYmPlME3LXTWZ6BAd55t9CmzZVM8fF7qWjX+Ye9BCdGxeQJTpT4n9BzZ77rV JZhkzX0yihTABumbYM1dj1/OtX8Elr252FnrSzh+DPK0xfEPhRbxN19HpAU1Z9T9D1// zQQw== X-Gm-Message-State: AOJu0Yzg90/hyTjsXSH6CztBb0gp/CPvgR8EdccBj7JBVIDUdsc1/yWj AymocM+Y/ryPJoGhcejQiAl380xRGbeAyDZEUKiBM2TKs87EB215WhvMujHF X-Google-Smtp-Source: AGHT+IGL7LD7R2TvKk2D8WvG2i5bKTXf3yZk/agTxdLwKtOixbWoaKuVGTDsReSvvTJRhFfoj+4v7Q== X-Received: by 2002:a05:6512:619:b0:515:9c73:e2a4 with SMTP id b25-20020a056512061900b005159c73e2a4mr7877772lfe.56.1712063362527; Tue, 02 Apr 2024 06:09:22 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id m15-20020a056512358f00b005159fa03501sm1704109lfr.302.2024.04.02.06.09.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:09:22 -0700 (PDT) From: Paul Donald To: openwrt-devel@lists.openwrt.org Subject: [PATCH 4/5] dnsmasq: quoted path variables Date: Tue, 2 Apr 2024 15:09:18 +0200 Message-ID: <20240402130919.58881-4-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402130919.58881-1-newtwen+github@gmail.com> References: <20240402130919.58881-1-newtwen+github@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_140924_953995_E9557547 X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Prevents problems when variables contain spaces. Tested on: 23.05.3 Signed-off-by: Paul Donald --- .../services/dnsmasq/files/dnsmasq.init | 32 +++++++++ 1 file changed, 16 insertions(+), 16 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:133 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [newtwen+github(at)gmail.com] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Prevents problems when variables contain spaces. Tested on: 23.05.3 Signed-off-by: Paul Donald --- .../services/dnsmasq/files/dnsmasq.init | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 9b98bbb015..0b1a71aee4 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -69,7 +69,7 @@ xappend() { local opt="${value%%=*}" if ! dnsmasq_ignore_opt "$opt"; then - echo "$value" >>$CONFIGFILE_TMP + echo "$value" >>"$CONFIGFILE_TMP" fi } @@ -354,7 +354,7 @@ dhcp_host_add() { config_get_bool dns "$cfg" dns 0 [ "$dns" = "1" ] && [ -n "$ip" ] && [ -n "$name" ] && { - echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE_TMP + echo "$ip $name${DOMAIN:+.$DOMAIN}" >> "$HOSTFILE_TMP" } config_get mac "$cfg" mac @@ -714,7 +714,7 @@ dhcp_domain_add() { record="${record:+$record }$name" done - echo "$ip $record" >> $HOSTFILE_TMP + echo "$ip $record" >> "$HOSTFILE_TMP" } dhcp_srv_add() { @@ -882,13 +882,13 @@ dnsmasq_start() # before we can call xappend umask u=rwx,g=rx,o=rx mkdir -p /var/run/dnsmasq/ - mkdir -p $(dirname $CONFIGFILE) + mkdir -p "$(dirname "$CONFIGFILE")" mkdir -p "$HOSTFILE_DIR" mkdir -p /var/lib/misc chown dnsmasq:dnsmasq /var/run/dnsmasq - echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE_TMP - echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE_TMP + echo "# auto-generated config file from /etc/config/dhcp" > "$CONFIGFILE_TMP" + echo "# auto-generated config file from /etc/config/dhcp" > "$HOSTFILE_TMP" local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf" if [ ! -r "$dnsmasqconffile" ]; then @@ -1126,7 +1126,7 @@ dnsmasq_start() [ ! -d "$dnsmasqconfdir" ] && mkdir -p "$dnsmasqconfdir" xappend "--user=dnsmasq" xappend "--group=dnsmasq" - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" # EXTRACONFFILE allows new dnsmasq parameters before they are natively handled in this init file config_get extraconftext "$cfg" extraconftext @@ -1139,7 +1139,7 @@ dnsmasq_start() } config_foreach filter_dnsmasq host dhcp_host_add "$cfg" - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" config_get_bool dhcpbogushostname "$cfg" dhcpbogushostname 1 [ "$dhcpbogushostname" -gt 0 ] && { @@ -1160,10 +1160,10 @@ dnsmasq_start() config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg" [ -n "$BOOT" ] || config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg" - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg" config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg" - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" config_get_bool boguspriv "$cfg" boguspriv 1 [ "$boguspriv" -gt 0 ] && { @@ -1185,16 +1185,16 @@ dnsmasq_start() fi - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg" - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" config_foreach filter_dnsmasq ipset dnsmasq_ipset_add "$cfg" - echo >> $CONFIGFILE_TMP + echo >> "$CONFIGFILE_TMP" - mv -f $CONFIGFILE_TMP $CONFIGFILE - mv -f $HOSTFILE_TMP $HOSTFILE + mv -f "$CONFIGFILE_TMP" "$CONFIGFILE" + mv -f "$HOSTFILE_TMP" "$HOSTFILE" [ "$localuse" -gt 0 ] && { rm -f /tmp/resolv.conf From patchwork Tue Apr 2 13:09:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1918813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=JYhKWYnm; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=XEuEIw4i; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=J9l+Ry6/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V87YR3X4mz1yZ3 for ; Wed, 3 Apr 2024 00:11:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=irgmQNlUcMiC37olfTPaizXPUndl8UxYDHd+XSUayYI=; b=JYhKWYnmPYsYI+ xjtsKosFIdqnaJ/BPdthRcFc4iRawYNEwwZGo5j+9Jp5TD1EZ1P62+eJqWyvINCtAUgwi+9JBpyEY 1qyL/ro2gaL3Cn5R2JwNol3SmmAMsp8TpPI0lIO4cID0DTZhmbxTKszowQABJI2Cb5Gpz4MicXr0+ CrChkY6cuNfGdHXLFCEdNg1oo6BFxx5FeW+nKTWLWwsbOuPR8UMHzyf0Z5UkEsk0jx4prnj4+dvEc 79JzQopsgCH8tuDRbrUetk816hriRZHzd9N022E7VrG4hpNljUxfn9zHQBzdHj9xdMs/XxP7tKAom ZLr5eo1ABvBek5PwVczA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdta-0000000BGYM-3xZn; Tue, 02 Apr 2024 13:09:46 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtM-0000000BGQY-2zb0 for openwrt-devel@bombadil.infradead.org; Tue, 02 Apr 2024 13:09:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description; bh=8yMl4zstUFRJLIMwU1ftwNA6t9NEd96Am+zBOgiHxwg=; b=XEuEIw4iiEQchI5vxaqXflEXdB 5CBI0HvcL+k6pktYMWnQ4PN2/MbM8UxhgXqQffIFvX3j8/xc9sVAiRQ+tgIRN+GCAHxqIsGRsAlgU YUuO10MbTSX9nmdun2sBmcvsEJ0A2aYrfzffMwuvptERlWwTjuGeZZVON2rtJtBB3uP7gBpn0m5yH lSuSakzP+q5XMLQ1und1oqhID8NucHVSfO17Au1s+WnB+4Zq0FyDJAaXpiz3wKmdSoDgZeo+EPBUe 7aOwdf/Fy3fPZjQhHRlftX8itOI8xrH1uNb1UT9Cr/khZ+m6RQXX6pAKDGUSQv3TlaFbXra2SayNG ++duYrVA==; Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdtJ-000000036ND-12tr for openwrt-devel@lists.openwrt.org; Tue, 02 Apr 2024 13:09:31 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-516a97b3139so2118896e87.2 for ; Tue, 02 Apr 2024 06:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712063365; x=1712668165; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=8yMl4zstUFRJLIMwU1ftwNA6t9NEd96Am+zBOgiHxwg=; b=J9l+Ry6//ZkmMdYn7yEdm3urMLhw8KcolaQHwiQeg47gFrB/CX7EZlKzZ+uO8N3AUc GNmkUL37leH1CJ0zaN+XwG26wxNuWbkUbdJhvXLyXrQpthteB/I82sJHYJxg0B2z1Nfc bjc8VqCr11ejyqo0vojkzRetIH8Nr5i3Zr2N49ll/CEtoZfr25I9ih35DI7RDi46tePU 6sJa69Elf72QG31wC1Uo4710cHqm9cX3eKTSyiFxvWfnZTBgowXTRpB2w0Qss8gw+Lxb wLEuIlNrbGg4RhpU9XLrobw963UNncy+NEhihEv9Cznzuf9s3qg0Xv3ST0HYP7MlaYIb KvIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712063365; x=1712668165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=8yMl4zstUFRJLIMwU1ftwNA6t9NEd96Am+zBOgiHxwg=; b=jGRH39di+eXxPRILANNgPUso7sxNayD6Vt76G4/vuT5A2vArTB17Vxb0jcWT0tMO6E 5X7jhCzLvFwF5S/sgaG2oOcElv9cwz43vuJnNhAaKR5gFPI0TPQoP+CT9g6V2i+bJNk6 ttdE51S3HBsI5gx44aLZvPMJJOgskhPlzpvOgiA7nj5k9FY7LvEXYG/Xf7Daz97SmotY MFn7gkDShrbuSKObxLHPe5hsIoe52uaFAFY5vT2r7VN4YpddxQoRvFHlNxMIHq2AntVU RBnsz+xfXAPGZms5Xu17e+/bJF9R+/KmmMGhBRGtWUfvQxraMQoV6s+k3duvC6b9qfeZ ND8g== X-Gm-Message-State: AOJu0YwYs4SVR4RZQREHT3/UtFuGhPUzf/bRR/38DU37cNsKHszCOLGO 2Mh4nSqDLE/1WpeCgzGIMesO6zorPyyjgMWUEXWjOC6quKDhumIt6qyWQExu X-Google-Smtp-Source: AGHT+IHt5wW81c16gc+Y4Bga6a/Xbzu6P73+3bmF6PQ21zw02akwk5sHOxmrWIgT3qkRFGlbUhZVag== X-Received: by 2002:a19:7506:0:b0:513:9b6d:ab0e with SMTP id y6-20020a197506000000b005139b6dab0emr7613599lfe.5.1712063362946; Tue, 02 Apr 2024 06:09:22 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id m15-20020a056512358f00b005159fa03501sm1704109lfr.302.2024.04.02.06.09.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:09:22 -0700 (PDT) From: Paul Donald To: openwrt-devel@lists.openwrt.org Subject: [PATCH 5/5] dnsmasq: add handling of `dns-rr` to init script (add arbitrary resource records) Date: Tue, 2 Apr 2024 15:09:19 +0200 Message-ID: <20240402130919.58881-5-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402130919.58881-1-newtwen+github@gmail.com> References: <20240402130919.58881-1-newtwen+github@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_140929_315079_B5BC8176 X-CRM114-Status: GOOD ( 10.32 ) X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 4.0.0 on casper.infradead.org summary: Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [newtwen+github(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:129 listed in] [list.dnswl.org] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add support for handling of DNS RR (Resource Records) requests, which are needed for the HTTPS Type 65 records, introduced to support the DNS-based Service Discovery (DNS-SD) mechanism for HTTPS services and defined in the RFC 9460 (9.1. Query Names for HTTPS RRs). Ref: https://forum.openwrt.org/t/resolving-query-type-65-to-local-address-for-ios-clients-in-dnsmasq/179504/11 uci config usage: config dns_rr option rrname 'foo.example.com' option rrnumber '65' option hexdata '00' hexdata is optional. Available since dnsmasq 2.62 (for around 12 years at this point). Tested on 22.03.5 Signed-off-by: Paul Donald --- package/network/services/dnsmasq/Makefile | 2 +- .../services/dnsmasq/files/dnsmasq.init | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 5224e996a4..0a597c03ce 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.90 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/ diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 0b1a71aee4..8936ae7f75 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -788,6 +788,28 @@ dhcp_hostrecord_add() { xappend "--host-record=$record" } +dhcp_dnsrr_add() { + #This adds arbitrary resource record types (of IN class) whose optional data must be hex + local cfg="$1" + local rrname rrnumber hexdata + + config_get rrname "$cfg" rrname + [ -n "$rrname" ] || return 0 + + config_get rrnumber "$cfg" rrnumber + [ -n "$rrnumber" ] && [ "$rrnumber" -gt 0 ] || return 0 + + config_get hexdata "$cfg" hexdata + + # dnsmasq accepts colon XX:XX:.., space XX XX .., or contiguous XXXX.. hex forms or mixtures thereof + if [ -n "${hexdata//[0-9a-fA-F\:\ ]/}" ]; then + # is invalid hex literal + return 1 + fi + + xappend "--dns-rr=${rrname},${rrnumber}${hexdata:+,$hexdata}" +} + dhcp_relay_add() { local cfg="$1" local local_addr server_addr interface @@ -1158,6 +1180,7 @@ dnsmasq_start() config_foreach filter_dnsmasq match dhcp_match_add "$cfg" config_foreach filter_dnsmasq domain dhcp_domain_add "$cfg" config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg" + config_foreach filter_dnsmasq dnsrr dhcp_dnsrr_add "$cfg" [ -n "$BOOT" ] || config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg" echo >> "$CONFIGFILE_TMP"