aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorEtan Kissling <etan.kissling@gmail.com>2021-06-26 12:11:49 +0000
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2021-06-26 13:28:47 +0100
commitdea4bae7c2b963af02e1e3e3bdb5cd656a5ea3d3 (patch)
tree8bbf5e37f22233ed79c7c091bf14d620260cb6fd /package/network
parent3628870015ef46eacf2c936f36e3c1ed3b4c9855 (diff)
downloadupstream-dea4bae7c2b963af02e1e3e3bdb5cd656a5ea3d3.tar.gz
upstream-dea4bae7c2b963af02e1e3e3bdb5cd656a5ea3d3.tar.bz2
upstream-dea4bae7c2b963af02e1e3e3bdb5cd656a5ea3d3.zip
dnsmasq: add config option for connmark DNS filtering
This adds uci support to configure connmark based DNS filtering. Signed-off-by: Etan Kissling <etan_kissling@apple.com> (See https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2021q2/015151.html) Signed-off-by: Etan Kissling <etan.kissling@gmail.com>
Diffstat (limited to 'package/network')
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init12
1 files changed, 12 insertions, 0 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 44e7d2d4f9..3e06218a43 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -172,6 +172,10 @@ append_ipset() {
xappend "--ipset=$1"
}
+append_connmark_allowlist() {
+ xappend "--connmark-allowlist=$1"
+}
+
append_interface() {
network_get_device ifname "$1" || ifname="$1"
xappend "--interface=$ifname"
@@ -913,6 +917,14 @@ dnsmasq_start()
config_list_foreach "$cfg" "rev_server" append_rev_server
config_list_foreach "$cfg" "address" append_address
config_list_foreach "$cfg" "ipset" append_ipset
+
+ local connmark_allowlist_enable
+ config_get connmark_allowlist_enable "$cfg" connmark_allowlist_enable 0
+ [ "$connmark_allowlist_enable" -gt 0 ] && {
+ append_parm "$cfg" "connmark_allowlist_enable" "--connmark-allowlist-enable"
+ config_list_foreach "$cfg" "connmark_allowlist" append_connmark_allowlist
+ }
+
[ -n "$BOOT" ] || {
config_list_foreach "$cfg" "interface" append_interface
config_list_foreach "$cfg" "notinterface" append_notinterface