diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-04-23 23:30:23 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-04-23 23:30:23 +0000 |
commit | 92d2426050d803e24137b73f375e30ac994065f3 (patch) | |
tree | fac518848e7c98ee1252889928356a19e198419d /etc/inc/config.inc | |
parent | 8ae8a3efba12ae122d1d1fa8fc8da3d49d26ddf5 (diff) | |
download | pfsense-92d2426050d803e24137b73f375e30ac994065f3.zip pfsense-92d2426050d803e24137b73f375e30ac994065f3.tar.gz |
Backport is_interface_mismatch() function
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r-- | etc/inc/config.inc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 0709641..b6dae66 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -1810,6 +1810,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', @@ -1830,4 +1852,4 @@ function set_device_perms() { if($g['booting']) echo "."; $config = parse_config(); -?> +?>
\ No newline at end of file |