summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2010-11-03 08:49:42 +0100
committerSeth Mos <seth.mos@dds.nl>2010-11-03 08:49:42 +0100
commit105d618d15d1cbb6e40a90b50f9dd5c0212acde8 (patch)
tree457e7add60176d35228ae8574c2f055dfe6c21f0 /etc/inc/util.inc
parent4ebde16510a7626f411253e70be0143c8376ae18 (diff)
parent729931965e68a3c8ab1de307446410f6810c4433 (diff)
downloadpfsense-105d618d15d1cbb6e40a90b50f9dd5c0212acde8.zip
pfsense-105d618d15d1cbb6e40a90b50f9dd5c0212acde8.tar.gz
Merge remote branch 'upstream/master'
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc28
1 files changed, 17 insertions, 11 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index ed6e77e..0b14b97 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -745,6 +745,9 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "")
if(stristr($status, "active")) $upints[] = $int;
}
break;
+ default:
+ $upints = explode(" ", trim(shell_exec("/sbin/ifconfig -l")));
+ break;
}
/* build interface list with netstat */
$linkinfo = "";
@@ -771,8 +774,9 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "")
$toput['ipaddr'] = $aip[1];
}
}
- foreach($config['interfaces'] as $name => $int) {
- if($int['if'] == $ifname) $friendly = $name;
+ if (is_array($config['interfaces'])) {
+ foreach($config['interfaces'] as $name => $int)
+ if($int['if'] == $ifname) $friendly = $name;
}
switch($keyby) {
case "physical":
@@ -1260,15 +1264,17 @@ function is_interface_mismatch() {
/* XXX: Should we process only enabled interfaces?! */
$do_assign = false;
$i = 0;
- foreach ($config['interfaces'] as $ifname => $ifcfg) {
- if (preg_match("/^enc|^cua|^tun|^l2tp|^pptp|^ppp|^ovpn|^gif|^gre|^lagg|^bridge|vlan|_wlan/i", $ifcfg['if'])) {
- $i++;
- }
- else if (does_interface_exist($ifcfg['if']) == false) {
- $do_assign = true;
- } else
- $i++;
- }
+ if (is_array($config['interfaces'])) {
+ foreach ($config['interfaces'] as $ifname => $ifcfg) {
+ if (preg_match("/^enc|^cua|^tun|^l2tp|^pptp|^ppp|^ovpn|^gif|^gre|^lagg|^bridge|vlan|_wlan/i", $ifcfg['if'])) {
+ $i++;
+ }
+ else if (does_interface_exist($ifcfg['if']) == false) {
+ $do_assign = true;
+ } else
+ $i++;
+ }
+ }
if ($g['minimum_nic_count'] > $i) {
$do_assign = true;
OpenPOWER on IntegriCloud