diff options
author | Ermal <eri@pfsense.org> | 2010-12-28 22:39:51 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-12-28 22:39:51 +0000 |
commit | 66bcba1bcd80677a38d63abbec5fb8316d55b7f4 (patch) | |
tree | 2b2da88ac7a344464814582159eb62623d448cda | |
parent | c3583058a0c2cd89ceacbbbcceb68a976e07a890 (diff) | |
download | pfsense-66bcba1bcd80677a38d63abbec5fb8316d55b7f4.zip pfsense-66bcba1bcd80677a38d63abbec5fb8316d55b7f4.tar.gz |
Ticket #802. During a config restore detect if the vlan interfaces need reassignment too. This might be problematic for other type of interfaces on 2.0!
-rw-r--r-- | etc/inc/util.inc | 15 | ||||
-rwxr-xr-x | usr/local/www/diag_backup.php | 7 | ||||
-rwxr-xr-x | usr/local/www/interfaces_assign.php | 6 |
3 files changed, 27 insertions, 1 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 3cc88e9..2dbf3ef 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -1237,6 +1237,19 @@ function start_devd() { sleep(1); } +function is_interface_vlan_mismatch() { + global $config, $g; + + if (is_array($config['vlans']['vlan'])) { + foreach ($config['vlans']['vlan'] as $vlan) { + if (does_interface_exist($vlan['if']) == false) + return true; + } + } + + return false; +} + function is_interface_mismatch() { global $config, $g; @@ -1485,4 +1498,4 @@ function array_merge_recursive_unique($array0, $array1) return $result; } -?>
\ No newline at end of file +?> diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index 410fb0b..6ff65fe 100755 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -451,6 +451,13 @@ if ($_POST) { header("Location: interfaces_assign.php"); exit; } + if (is_interface_vlan_mismatch() == true) { + touch("/var/run/interface_mismatch_reboot_needed"); + clear_subsystem_dirty("restore"); + convert_config(); + header("Location: interfaces_assign.php"); + exit; + } } else { $input_errors[] = gettext("The configuration could not be restored."); } diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 340ee78..3d2cec0 100755 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -191,6 +191,12 @@ if ($_POST['apply']) { } } + if (is_array($config['vlans']['vlan'])) { + foreach ($config['vlans']['vlan'] as $vlan) { + if (does_interface_exist($vlan['if']) == false) + $input_errors[] = "Vlan parent interface {$vlan['if']} does not exist anymore so vlan id {$vlan['tag']} cannot be created please fix the issue before continuing."; + } + } if (!$input_errors) { /* No errors detected, so update the config */ |