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>
Wed, 21 Feb 2024 21:31:36 +0000 (22:31 +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 5b6d00042249b44379b5e4d83c628adaf4643011..d6c126565efe75c9bca4f48822ef477097261cf5 100755 (executable)
@@ -970,6 +970,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"