summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-09-20 13:34:50 +0000
committerErmal Luçi <eri@pfsense.org>2008-09-20 13:34:50 +0000
commit4e7da37c2dfd4bc98f434913f5137a8cde846d85 (patch)
tree5dcf017757d0502b424beff6c725d50a1bce0283 /etc
parent7f04301d11b27b3071ed81c8cd6be4813af3b15c (diff)
downloadpfsense-4e7da37c2dfd4bc98f434913f5137a8cde846d85.zip
pfsense-4e7da37c2dfd4bc98f434913f5137a8cde846d85.tar.gz
Correctly determine interface mismatches.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.inc38
1 files changed, 15 insertions, 23 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index ccf548e..436924a 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -2820,29 +2820,21 @@ function start_devd() {
function is_interface_mismatch() {
global $config, $g;
- if(!$config['interfaces']['lan'])
- return false;
- if($config['interfaces']['wan']['ipaddr'] == "carpdev-dhcp")
- return false;
- $lan_if = $config['interfaces']['lan']['if'];
- $wan_if = get_real_wan_interface();
- $do_assign = 0;
- /* we need to ignore the vlan interface checks) */
- if (stristr($lan_if, "vlan") == false and stristr($wan_if, "vlan") == false) {
- if (does_interface_exist($lan_if) == false)
- if($g['minimum_nic_count'] > 1)
- $do_assign = 1;
- if ($config['interfaces']['wan']['ipaddr'] <> "pppoe" && $config['interfaces']['wan']['ipaddr'] <> "pptp" && $do_assign == 0)
- if (does_interface_exist($wan_if) == false)
- $do_assign = 1;
- }
- /* XXX: enumerate OPT interfaces looking for mismatches */
+
+ $do_assign = false;
+ foreach ($config['interfaces'] as $ifname => $ifcfg) {
+ if (preg_match("/^enc|^tun|^ppp|^pptp|^pppoe|^ovpn|^gif|^gre|^lagg|^bridge|^vlan/i", $ifcfg['if']))
+ continue;
+ if (does_interface_exist($ifcfg['if']) == false) {
+ file_notice("{$ifcfg['if']} is not present anymore on the system, you need to reassign interfaces or take appropriate actions.");
+ $do_assign = true;
+ }
+ }
+
if (file_exists("{$g['tmp_path']}/assign_complete"))
- return false;
- if ($do_assign == 1)
- return true;
- else
- return false;
+ $do_assign = false;
+
+ return $do_assign;
}
function set_device_perms() {
@@ -2865,4 +2857,4 @@ function set_device_perms() {
if($g['booting']) echo ".";
$config = parse_config();
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud