#
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=dhcp
PKG_VERSION:=3.1.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/
hosts_file=/tmp/dhcpd.hosts
dhcp_ifs=""
-append_interface() {
- local ifname=$(uci_get_state network "$1" device)
- if [ "$(uci_get_state network "$1" type)" = "bridge" ]; then
- ifname=$(uci_get_state network "$1" ifname); fi
-
- if [ -z "$dhcp_ifs" ]; then
- dhcp_ifs="$ifname"
- else
- dhcp_ifs="$dhcp_ifs $ifname"
- fi
-}
-
parse_dhcp() {
local cfg="$1"
config_get net "$cfg" interface
config_get_bool ignore "$1" ignore 0
if [ "$ignore" -eq 1 ]; then return 0; fi
- append_interface $net
+ local dev
+ network_get_device dev "$net" && append dhcp_ifs "$dev"
}
parse_host_entry() {
init_config() {
echo " #Automatically generated by dhcpd initscript, any modifications will be overwritten" > "$hosts_file"
- include /lib/network
- scan_interfaces
- config_load dhcp
+ . /lib/functions/network.sh
+ config_load dhcp
config_foreach parse_host_entry host
config_foreach parse_dhcp dhcp
}