Changeset 17897


Ignore:
Timestamp:
2009-10-05T18:58:06+02:00 (7 years ago)
Author:
jow
Message:

[package] dnsmasq:

  • make "name" option in "host" sections optional and append it to -G if set, allows specifying hostnames for static leases without resorting to /etc/hosts
  • implement "domain" sections, allows defining arbitary host names and associated ptr records from uci
  • bump package revision
Location:
trunk/package/dnsmasq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/dnsmasq/Makefile

    r17711 r17897  
    1010PKG_NAME:=dnsmasq 
    1111PKG_VERSION:=2.50 
    12 PKG_RELEASE:=1 
     12PKG_RELEASE:=2 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
  • trunk/package/dnsmasq/files/dnsmasq.init

    r17599 r17897  
    44START=60 
    55DNS_SERVERS="" 
     6DOMAIN="" 
    67 
    78dhcp_calc() { 
     
    8485        append_parm "$cfg" "dhcp_boot" "--dhcp-boot" 
    8586 
     87        config_get DOMAIN "$cfg" domain 
     88 
    8689        config_get leasefile $cfg leasefile 
    8790        [ -e "$leasefile" ] || touch "$leasefile" 
     
    166169 
    167170        config_get name "$cfg" name 
    168         [ -n "$name" ] || return 0 
     171        [ -n "$name" ] && dhcp_option_add "$cfg" "$name" 
    169172 
    170173        config_get mac "$cfg" mac 
     
    174177        [ -n "$ip" ] || return 0 
    175178 
    176         append args "--dhcp-host=$mac,$ip" 
    177  
    178         dhcp_option_add "$cfg" "$name" 
     179        append args "--dhcp-host=$mac,$ip${name:+,$name}" 
    179180} 
    180181 
     
    269270        done 
    270271 
     272} 
     273 
     274dhcp_domain_add() { 
     275        local cfg="$1" 
     276 
     277        config_get name "$cfg" name 
     278        [ -n "$name" ] || return 0 
     279 
     280        config_get ip "$cfg" ip 
     281        [ -n "$ip" ] || return 0 
     282 
     283        local oIFS="$IFS"; IFS="."; set -- $ip; IFS="$oIFS" 
     284        append args "-A /$name${DOMAIN:+.$DOMAIN}/$ip" 
     285        append args "--ptr-record=$4.$3.$2.$1.in-addr.arpa,$name${DOMAIN:+.$DOMAIN}" 
    271286} 
    272287 
     
    286301        config_foreach dhcp_remoteid_add remoteid 
    287302        config_foreach dhcp_subscrid_add subscrid 
     303        config_foreach dhcp_domain_add domain 
    288304        config_foreach dhcp_add dhcp 
    289305 
Note: See TracChangeset for help on using the changeset viewer.