mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
src: removal of get_configured_interface_list() 2/2
This commit is contained in:
parent
7c853d62a9
commit
8c00114edc
@ -832,13 +832,13 @@ function ipsec_configure_do($verbose = false, $interface = '')
|
||||
/* add an ipsec pinghosts entry */
|
||||
if ($ph2ent['pinghost']) {
|
||||
if (!isset($iflist) || !is_array($iflist)) {
|
||||
$iflist = get_configured_interface_list();
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
}
|
||||
$viplist = get_configured_vips_list();
|
||||
$srcip = null;
|
||||
$local_subnet = ipsec_idinfo_to_cidr($ph2ent['localid'], true, $ph2ent['mode']);
|
||||
if (is_ipaddrv6($ph2ent['pinghost'])) {
|
||||
foreach ($iflist as $ifent => $ifname) {
|
||||
foreach ($iflist as $ifent => $unused) {
|
||||
$interface_ip = get_interface_ipv6($ifent);
|
||||
if (!is_ipaddrv6($interface_ip)) {
|
||||
continue;
|
||||
@ -849,7 +849,7 @@ function ipsec_configure_do($verbose = false, $interface = '')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($iflist as $ifent => $ifname) {
|
||||
foreach ($iflist as $ifent => $unused) {
|
||||
$interface_ip = get_interface_ip($ifent);
|
||||
if (!is_ipaddrv4($interface_ip)) {
|
||||
continue;
|
||||
|
||||
@ -523,7 +523,7 @@ function unbound_add_host_entries()
|
||||
if (!empty($config['unbound']['active_interface'])) {
|
||||
$interfaces = explode(",", $config['unbound']['active_interface']);
|
||||
} else {
|
||||
$interfaces = get_configured_interface_list();
|
||||
$interfaces = array_keys(get_configured_interface_with_descr());
|
||||
}
|
||||
|
||||
foreach ($interfaces as $interface) {
|
||||
|
||||
@ -284,7 +284,7 @@ function services_radvd_configure($blacklist = array())
|
||||
|
||||
/* handle DHCP-PD prefixes and 6RD dynamic interfaces */
|
||||
/* XXX trade for legacy_config_get_interfaces(array('virtual' => false)) */
|
||||
foreach (get_configured_interface_list() as $if => $ifdescr) {
|
||||
foreach (get_configured_interface_with_descr() as $if => $unused) {
|
||||
if (!isset($config['interfaces'][$if]['track6-interface'])) {
|
||||
continue;
|
||||
} elseif (empty($config['interfaces'][$config['interfaces'][$if]['track6-interface']])) {
|
||||
@ -560,12 +560,13 @@ EOPP;
|
||||
}
|
||||
}
|
||||
|
||||
$Iflist = get_configured_interface_list();
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
|
||||
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
|
||||
$ifcfg = $config['interfaces'][$dhcpif];
|
||||
$newzone = array();
|
||||
|
||||
if (!isset($dhcpifconf['enable']) || !isset($Iflist[$dhcpif])) {
|
||||
if (!isset($dhcpifconf['enable']) || !isset($iflist[$dhcpif])) {
|
||||
continue;
|
||||
}
|
||||
$ifcfgip = get_interface_ip($dhcpif);
|
||||
@ -1086,8 +1087,8 @@ function services_dhcpdv6_configure($blacklist = array(), $verbose = false)
|
||||
return;
|
||||
}
|
||||
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
$dhcpdv6cfg = config_read_array('dhcpdv6');
|
||||
$Iflist = get_configured_interface_list();
|
||||
|
||||
/* Only consider DNS servers with IPv6 addresses for the IPv6 DHCP server. */
|
||||
$dns_arrv6 = array();
|
||||
@ -1105,7 +1106,7 @@ function services_dhcpdv6_configure($blacklist = array(), $verbose = false)
|
||||
}
|
||||
|
||||
/* we add a fake entry for interfaces that are set to track6 another WAN */
|
||||
foreach ($Iflist as $ifname) {
|
||||
foreach ($iflist as $ifname => $unused) {
|
||||
/* Do not put in the config an interface which is down */
|
||||
if (isset($blacklist[$ifname])) {
|
||||
continue;
|
||||
@ -1260,7 +1261,7 @@ EOD;
|
||||
foreach ($dhcpdv6cfg as $dhcpv6if => $dhcpv6ifconf) {
|
||||
$newzone = array();
|
||||
|
||||
if (!isset($dhcpv6ifconf['enable']) || !isset($Iflist[$dhcpv6if])) {
|
||||
if (!isset($dhcpv6ifconf['enable']) || !isset($iflist[$dhcpv6if])) {
|
||||
continue;
|
||||
}
|
||||
if (isset($blacklist[$dhcpv6if])) {
|
||||
@ -1465,7 +1466,7 @@ function services_dhcrelay_configure($verbose = false)
|
||||
flush();
|
||||
}
|
||||
|
||||
$iflist = get_configured_interface_list();
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
$dhcifaces = explode(",", $dhcrelaycfg['interface']);
|
||||
foreach ($dhcifaces as $dhcrelayif) {
|
||||
if (!isset($iflist[$dhcrelayif]) || link_interface_to_bridge($dhcrelayif)) {
|
||||
@ -1484,7 +1485,7 @@ function services_dhcrelay_configure($verbose = false)
|
||||
$srvips = explode(",", $dhcrelaycfg['server']);
|
||||
foreach ($srvips as $srcidx => $srvip) {
|
||||
unset($destif);
|
||||
foreach ($iflist as $ifname) {
|
||||
foreach ($iflist as $ifname => $unused) {
|
||||
$subnet = get_interface_ip($ifname);
|
||||
if (!is_ipaddr($subnet)) {
|
||||
continue;
|
||||
@ -1584,7 +1585,7 @@ function services_dhcrelay6_configure($verbose = false)
|
||||
flush();
|
||||
}
|
||||
|
||||
$iflist = get_configured_interface_list();
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
$dhcifaces = explode(",", $dhcrelaycfg['interface']);
|
||||
foreach ($dhcifaces as $dhcrelayif) {
|
||||
if (!isset($iflist[$dhcrelayif]) || link_interface_to_bridge($dhcrelayif)) {
|
||||
@ -1605,7 +1606,7 @@ function services_dhcrelay6_configure($verbose = false)
|
||||
$srvifaces = array();
|
||||
foreach ($srvips as $srcidx => $srvip) {
|
||||
unset($destif);
|
||||
foreach ($iflist as $ifname) {
|
||||
foreach ($iflist as $ifname => $unused) {
|
||||
$subnet = get_interface_ipv6($ifname);
|
||||
if (!is_ipaddrv6($subnet)) {
|
||||
continue;
|
||||
|
||||
@ -749,17 +749,6 @@ function get_configured_vips_list()
|
||||
return $alias_list;
|
||||
}
|
||||
|
||||
function get_configured_interface_list()
|
||||
{
|
||||
$iflist = array();
|
||||
|
||||
foreach (legacy_config_get_interfaces(array('virtual' => false)) as $if => $ifdetail) {
|
||||
$iflist[$if] = $if;
|
||||
}
|
||||
|
||||
return $iflist;
|
||||
}
|
||||
|
||||
function get_configured_interface_with_descr($only_opt = false, $withdisabled = false)
|
||||
{
|
||||
$iflist = array();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user