dnsmasq currently permits dhcp_options to be specified only in "config dhcp"
sections of /etc/config/dhcp. When dnsmasq is providing DHCP service for
multiple subnets and there are multiple "config dhcp" sections without "option
ignore", it makes sense to allow dhcp_options that should apply globally in
the "config dnsmasq" section of /etc/config/dhcp. dhcp_option is a list option.

Signed-off-by: Mark Mentovai <[email protected]>

Index: package/dnsmasq/files/dnsmasq.init
===================================================================
--- package/dnsmasq/files/dnsmasq.init  (revision 31782)
+++ package/dnsmasq/files/dnsmasq.init  (working copy)
@@ -143,6 +143,8 @@
                config_list_foreach "$cfg" rebind_domain append_rebind_domain
        }
 
+       dhcp_option_add "$cfg" ""
+
        echo >> $CONFIGFILE
 }
 
@@ -325,9 +327,12 @@
        local cfg="$1"
        local networkid="$2"
 
+       local networkid_comma
+       [ -n "$networkid" ] && networkid_comma="$networkid",
+
        config_get dhcp_option "$cfg" dhcp_option
        for o in $dhcp_option; do
-               xappend "--dhcp-option=$networkid","$o"
+               xappend "--dhcp-option=$networkid_comma$o"
        done
 
 }
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to