Changeset 26983


Ignore:
Timestamp:
2011-05-24T11:12:50+02:00 (7 years ago)
Author:
jow
Message:

[PATCH] dnsmasq: allow hostname assignment without static lease
The attached patch for dnsmasq.init allows to assign a hostname to a
particular mac-address. It's useful to override the client supplied
hostname, especially if the client does not supply a hostname at all.

It corresponds to the following example in dnsmasq.conf.example:

# Always set the name of the host with hardware address
# 11:22:33:44:55:66 to be "fred"
#dhcp-host=11:22:33:44:55:66,fred


Regards
Mathias

Location:
trunk/package/dnsmasq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/dnsmasq/Makefile

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

    r25540 r26983  
    207207        local cfg="$1" 
    208208 
     209        config_get networkid "$cfg" networkid 
     210        [ -n "$networkid" ] && dhcp_option_add "$cfg" "$networkid" 
     211 
    209212        config_get name "$cfg" name 
    210  
    211         config_get networkid "$cfg" networkid 
    212         [ -n "$networkid" ] && dhcp_option_add "$cfg" "$networkid" 
    213  
    214213        config_get ip "$cfg" ip 
    215         [ -n "$ip" ] || return 0 
     214        [ -n "$ip" ] || [ -n "$name" ] || return 0 
    216215 
    217216        macs="" 
     
    220219        [ -n "$macs" ] || return 0 
    221220 
    222         append args "--dhcp-host=$macs,${networkid:+net:$networkid,}$ip${name:+,$name}" 
     221        append args "--dhcp-host=$macs${networkid:+,net:$networkid}${ip:+,$ip}${name:+,$name}" 
    223222} 
    224223 
Note: See TracChangeset for help on using the changeset viewer.