summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-24 00:47:11 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-24 00:47:11 +0000
commit914a762d23d527bae849260cbf0ea7646b847ce7 (patch)
treec7d7c70bc85e21f902d4180dbc6024e2615e7b38 /etc/inc/config.inc
parent8b1f580608992558afd6151ce049f00a23781226 (diff)
downloadpfsense-914a762d23d527bae849260cbf0ea7646b847ce7.zip
pfsense-914a762d23d527bae849260cbf0ea7646b847ce7.tar.gz
* Use is_interface_mismatch() function * Do not allow configuration to continue until the interfaces are setup correctly * When restoring a configuration via the webConfigurator detect that a interface mismatch has occured and redirect the user to the assign interface screen. Once the assign interface Save button has been pressed go ahead and reboot. This might just prevent someone from throwing a fit since they do not have console access.
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 760f26e..c2270d6 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -1763,6 +1763,28 @@ function start_devd() {
unlink("/tmp/rc.linkup");
}
+function is_interface_mismatch() {
+ global $config, $g;
+ $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)
+ $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 */
+ if (file_exists("{$g['tmp_path']}/assign_complete"))
+ return false;
+ if ($do_assign == 1)
+ return true;
+ else
+ return false;
+}
+
function set_device_perms() {
$devices = array(
'pf' => array( 'user' => 'proxy',
OpenPOWER on IntegriCloud