dhcp_option_add "$cfg" "$networkid"
}
+dhcp_option_append() {
+ local option="$1"
+ local networkid="$2"
+ local force="$3"
+
+ xappend "--dhcp-option${force:+-force}=${networkid:+$networkid,}$option"
+}
+
dhcp_option_add() {
# NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions
local cfg="$1"
[ "$force" = "0" ] && force=
- config_get dhcp_option "$cfg" dhcp_option
- for o in $dhcp_option; do
- xappend "--dhcp-option${force:+-force}=${networkid:+$networkid,}$o"
- done
+ local list_len
+ config_get list_len "$cfg" dhcp_option_LENGTH
+
+ if [ -n "$list_len" ]; then
+ config_list_foreach "$cfg" dhcp_option dhcp_option_append "$networkid" "$force"
+ else
+ echo "Warning: the 'option dhcp_option' syntax is deprecated, use 'list dhcp_option'" >&2
+ config_get dhcp_option "$cfg" dhcp_option
+ local option
+ for option in $dhcp_option; do
+ dhcp_option_append "$option" "$networkid" "$force"
+ done
+ fi
}
dhcp_domain_add() {