dnsmasq: fix handlers for options `filter_rr` and `cache_rr`
authorEric ZHANG <[email protected]>
Sun, 2 Mar 2025 07:54:37 +0000 (15:54 +0800)
committerChristian Marangi <[email protected]>
Sun, 9 Mar 2025 16:28:50 +0000 (17:28 +0100)
commit2b0cce92ae3cd58a96c407d1908693deec6fdf6b
tree3f7109dd825806f8933e72848fae59838413c1df
parentd00ed19ed4cbeb446741ef977b63d7c96a045323
dnsmasq: fix handlers for options `filter_rr` and `cache_rr`

According to:
- https://github.com/openwrt/luci/blob/master/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js#L700
- https://github.com/openwrt/luci/blob/master/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js#L402

These two options should be of type `MultiValue` but here there're used as single value. This results in dnsmasq crashes when either of these options are set with multiple values, which leads to an invalid space-separated value.

As these options are designed to take multiple values, I think it's better to use list format eg. `list filter_rr 'AAAA'`, instead of `option filter_rr 'AAAA,HTTPS'`.

See: https://forum.openwrt.org/t/selecting-more-than-one-filter-arbitrary-rr-or-cache-arbitrary-rr-in-v24-10-0-crashes-dnsmasq/225801

Tested on 24.10.0

Signed-off-by: Eric ZHANG <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/18149
Signed-off-by: Christian Marangi <[email protected]>
(cherry picked from commit d136c24f7cc9f7b5ac72259ccf9193683f4ced74)
package/network/services/dnsmasq/files/dnsmasq.init