Change dnsmasq domain and local options to lists
Username: cimbalo
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=853
On LEDE 17.01 ‘domain’ and ‘local’ options in dnsmasq configuration doesn’t correctly support lists values as per dnsmasq capabilities.
Steps to reproduce
#/etc/config/dhcp [...] config dnsmasq list domain 'example1.com,192.168.0.0/24' list domain 'example2.com,192.168.1.0/24' list local '/example1.com/' list local '/example2.com/' [...]
$ uci commit dhcp
$ /etc/init.d/dnsmasq restart
Actual results
#/var/etc/dnsmasq.conf.cfg02411c [...] domain=example1.com,192.168.0.0/24 example2.com,192.168.1.0/24 local=/example1.com/ /example2.com/ [...]
Expected results
#/var/etc/dnsmasq.conf.cfg02411c [...] domain=example1.com,192.168.0.0/24 domain=example2.com,192.168.1.0/24 local=/example1.com/ local=/example2.com/ [...]
Workaround
Replace append_parm with config_list_foreach
here
resolve the issue.
I’m attaching a patch for the 17.01 dnsmasq init script but it will break old uci configuration that use ‘option’ instead of ‘list’.
Do you have any suggestion on how to migrate old configuration and set those parameters as lists in uci web interface?