dnsmasq: add a new "dnsfilter" configuration option
authorRui Salvaterra <rsalvaterra@gmail.com>
Mon, 13 Dec 2021 15:00:17 +0000 (15:00 +0000)
committerJo-Philipp Wich <jo@mein.io>
Sun, 26 Jan 2025 13:09:26 +0000 (14:09 +0100)
Add UCI support for record filtering in dnsmasq replies. The new "dnsfilter"
option can take either "A" or "AAAA" as possible values, enabling filtering of
IPv4 or IPv6 addresses, respectively.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
package/network/services/dnsmasq/files/dnsmasq.init

index bb75fa31ed42d027a4747e9eaddf32f667fc5f96..d20217ff7aaefafe053a9e6b485cc990ca5532a7 100755 (executable)
@@ -994,6 +994,13 @@ dnsmasq_start()
                        ;;
        esac
 
+       config_get dnsfilter "$cfg" "dnsfilter"
+       case "$dnsfilter" in
+               A|AAAA)
+                       xappend "--filter-$dnsfilter"
+                       ;;
+       esac
+
        append_bool "$cfg" fqdn "--dhcp-fqdn"
        append_bool "$cfg" proxydnssec "--proxy-dnssec"
        append_bool "$cfg" localservice "--local-service"