diff options
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-x | usr/local/www/services_dhcp.php | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 2c46379..bdfe57f 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -39,30 +39,21 @@ if ($_POST['if']) if($config['installedpackages']['olsrd']) { foreach($config['installedpackages']['olsrd']['config'] as $olsrd) { if($olsrd['enable']) { - $iflist = array("lan" => "LAN", "wan" => "WAN"); $is_olsr_enabled = true; break; } } } -if($config['interfaces']['lan']) { - if(!$iflist) - $iflist = array("lan" => "LAN"); -} else { - /* if WAN is configured for anything other than static - IP, do not allow DHCP server to be configured. */ - if (!is_ipaddr($config['interfaces']['wan']['ipaddr'])) - $singleif_nostaticip = true; - $iflist = array("wan" => strtoupper($g['wan_interface_name'])); -} +$ifdescrs = get_configured_interface_with_descr(); -for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { - $oc = $config['interfaces']['opt' . $i]; +foreach ($ifdescrs as $ifname => $ifdesc) { + $oc = $config['interfaces'][$ifname]; - if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge'])) { - $iflist['opt' . $i] = $oc['descr']; - } + if (!is_ipaddr($oc['ipaddr']) && $is_olsr_enabled) + $singleif_nostaticip = true; + else if ($oc['if'] && (!$oc['bridge'])) + $iflist[$ifname] = $ifdesc['descr']; } /* set the starting interface */ |