Changeset 31977


Ignore:
Timestamp:
2012-05-29T03:47:58+02:00 (6 years ago)
Author:
jow
Message:

[packages] dhcp: use network.sh to find device names

Location:
packages/net/dhcp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/dhcp/Makefile

    r30707 r31977  
    11# 
    2 # Copyright (C) 2006-2011 OpenWrt.org 
     2# Copyright (C) 2006-2012 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=dhcp 
    1111PKG_VERSION:=3.1.0 
    12 PKG_RELEASE:=4 
     12PKG_RELEASE:=5 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
  • packages/net/dhcp/files/dhcpd.init

    r26998 r31977  
    88dhcp_ifs="" 
    99 
    10 append_interface() { 
    11         local ifname=$(uci_get_state network "$1" device) 
    12         if [ "$(uci_get_state network "$1" type)" = "bridge" ]; then 
    13                 ifname=$(uci_get_state network "$1" ifname); fi 
    14  
    15         if [ -z "$dhcp_ifs" ]; then 
    16                 dhcp_ifs="$ifname" 
    17         else 
    18                 dhcp_ifs="$dhcp_ifs $ifname" 
    19         fi 
    20 } 
    21  
    2210parse_dhcp() { 
    2311        local cfg="$1" 
     
    2816        if [ "$ignore" -eq 1 ]; then return 0; fi 
    2917 
    30         append_interface $net 
     18        local dev 
     19        network_get_device dev "$net" && append dhcp_ifs "$dev" 
    3120} 
    3221 
     
    5746        echo " #Automatically generated by dhcpd initscript, any modifications will be overwritten" > "$hosts_file" 
    5847 
    59         include /lib/network 
    60         scan_interfaces 
     48        . /lib/functions/network.sh 
     49 
    6150        config_load dhcp 
    62  
    6351        config_foreach parse_host_entry host 
    6452        config_foreach parse_dhcp dhcp 
Note: See TracChangeset for help on using the changeset viewer.