Revision 66bcba1b
Added by Ermal LUÇI over 14 years ago
etc/inc/util.inc | ||
---|---|---|
1237 | 1237 |
sleep(1); |
1238 | 1238 |
} |
1239 | 1239 |
|
1240 |
function is_interface_vlan_mismatch() { |
|
1241 |
global $config, $g; |
|
1242 |
|
|
1243 |
if (is_array($config['vlans']['vlan'])) { |
|
1244 |
foreach ($config['vlans']['vlan'] as $vlan) { |
|
1245 |
if (does_interface_exist($vlan['if']) == false) |
|
1246 |
return true; |
|
1247 |
} |
|
1248 |
} |
|
1249 |
|
|
1250 |
return false; |
|
1251 |
} |
|
1252 |
|
|
1240 | 1253 |
function is_interface_mismatch() { |
1241 | 1254 |
global $config, $g; |
1242 | 1255 |
|
... | ... | |
1485 | 1498 |
return $result; |
1486 | 1499 |
} |
1487 | 1500 |
|
1488 |
?> |
|
1501 |
?> |
usr/local/www/diag_backup.php | ||
---|---|---|
451 | 451 |
header("Location: interfaces_assign.php"); |
452 | 452 |
exit; |
453 | 453 |
} |
454 |
if (is_interface_vlan_mismatch() == true) { |
|
455 |
touch("/var/run/interface_mismatch_reboot_needed"); |
|
456 |
clear_subsystem_dirty("restore"); |
|
457 |
convert_config(); |
|
458 |
header("Location: interfaces_assign.php"); |
|
459 |
exit; |
|
460 |
} |
|
454 | 461 |
} else { |
455 | 462 |
$input_errors[] = gettext("The configuration could not be restored."); |
456 | 463 |
} |
usr/local/www/interfaces_assign.php | ||
---|---|---|
191 | 191 |
} |
192 | 192 |
} |
193 | 193 |
|
194 |
if (is_array($config['vlans']['vlan'])) { |
|
195 |
foreach ($config['vlans']['vlan'] as $vlan) { |
|
196 |
if (does_interface_exist($vlan['if']) == false) |
|
197 |
$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."; |
|
198 |
} |
|
199 |
} |
|
194 | 200 |
|
195 | 201 |
if (!$input_errors) { |
196 | 202 |
/* No errors detected, so update the config */ |
Also available in: Unified diff
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!