Add support for SRV records to dnsmasq config parsing
authorPeter Denison <openwrt@marshadder.org>
Sat, 8 May 2010 12:35:29 +0000 (12:35 +0000)
committerPeter Denison <openwrt@marshadder.org>
Sat, 8 May 2010 12:35:29 +0000 (12:35 +0000)
SVN-Revision: 21400

package/dnsmasq/files/dnsmasq.init

index 15f856d4e58d7f80d1d3ac739f0c015381d8fa7a..9bf89fa6dfe21d2d49faf4582ac84cb7485334ae 100644 (file)
@@ -310,6 +310,23 @@ dhcp_domain_add() {
        done
 }
 
+dhcp_srv_add() {
+       local cfg="$1"
+
+       config_get srv "$cfg" srv
+       [ -n "$srv" ] || return 0
+
+       config_get target "$cfg" target
+       [ -n "$target" ] || return 0
+
+       config_get port "$cfg" port
+
+       local service="$srv,$target"
+       [ -n "$port" ] && service="$service,$port"
+
+       append args "-W $service"
+}
+
 start() {
        include /lib/network
        scan_interfaces
@@ -326,6 +343,7 @@ start() {
        config_foreach dhcp_remoteid_add remoteid
        config_foreach dhcp_subscrid_add subscrid
        config_foreach dhcp_domain_add domain
+       config_foreach dhcp_srv_add srvhost
        config_foreach dhcp_add dhcp
 
        /usr/sbin/dnsmasq $args && {