summaryrefslogtreecommitdiffstats
path: root/usr/local/www/interfaces_vlan_edit.php
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-06-04 21:37:15 +0000
committerErmal Luçi <eri@pfsense.org>2008-06-04 21:37:15 +0000
commita3f9082f46e573fab5b600a94ed8f721a9f6c74d (patch)
treeaa8e1e3224b9890e969feacf1dd40db54d54cc7a /usr/local/www/interfaces_vlan_edit.php
parent2075fadb5fce5e844d96c500cdc804a1bb7f1da9 (diff)
downloadpfsense-a3f9082f46e573fab5b600a94ed8f721a9f6c74d.zip
pfsense-a3f9082f46e573fab5b600a94ed8f721a9f6c74d.tar.gz
Fix braindead vlan creation procedures.
Now we do not need to go through all vlans just to delete/create one of them.
Diffstat (limited to 'usr/local/www/interfaces_vlan_edit.php')
-rwxr-xr-xusr/local/www/interfaces_vlan_edit.php58
1 files changed, 34 insertions, 24 deletions
diff --git a/usr/local/www/interfaces_vlan_edit.php b/usr/local/www/interfaces_vlan_edit.php
index b5384c7..87775ad 100755
--- a/usr/local/www/interfaces_vlan_edit.php
+++ b/usr/local/www/interfaces_vlan_edit.php
@@ -44,6 +44,7 @@ if (isset($_POST['id']))
if (isset($id) && $a_vlans[$id]) {
$pconfig['if'] = $a_vlans[$id]['if'];
+ $pconfig['vlanif'] = $a_vlans[$id]['vlanif'];
$pconfig['tag'] = $a_vlans[$id]['tag'];
$pconfig['descr'] = $a_vlans[$id]['descr'];
}
@@ -79,33 +80,42 @@ if ($_POST) {
$vlan['tag'] = $_POST['tag'];
$vlan['descr'] = $_POST['descr'];
- if (isset($id) && $a_vlans[$id])
- $a_vlans[$id] = $vlan;
- else
- $a_vlans[] = $vlan;
+ $vlan['vlanif'] = interface_vlan_configure($vlan['if'], $vlan['tag']);
+ if ($vlan['vlanif'] == "" || !stristr($vlan['vlanif'], "vlan"))
+ $input_errors[] = "Error occured creating interface, please retry.";
+ else {
+ if (isset($id) && $a_vlans[$id])
+ $a_vlans[$id] = $vlan;
+ else
+ $a_vlans[] = $vlan;
- write_config();
+ write_config();
- /* TODO
- this does not always work, some systems require
- a reboot before VLANs function properly. Suspect
- FreeBSD driver issue.
+
+ /* TODO
+ this does not always work, some systems require
+ a reboot before VLANs function properly. Suspect
+ FreeBSD driver issue.
- This portion of code is also very slow, this is why
- it takes a long time to add a new VLAN.
- Benchmark_Timer on a 800 MHz VIA:
- interfaces_lan_configure() takes about 6 seconds
- interfaces_wan_configure() takes about 9.5 seconds
- interfaces_optional_configure() takes about 5 seconds
- */
-
- interfaces_vlan_configure();
- interfaces_lan_configure();
- interfaces_wan_configure();
- interfaces_optional_configure();
-
- header("Location: interfaces_vlan.php");
- exit;
+ This portion of code is also very slow, this is why
+ it takes a long time to add a new VLAN.
+ Benchmark_Timer on a 800 MHz VIA:
+ interfaces_lan_configure() takes about 6 seconds
+ interfaces_wan_configure() takes about 9.5 seconds
+ interfaces_optional_configure() takes about 5 seconds
+ */
+
+ /* XXX: ermal -- on my test these now are only needed if the vlan
+ modification touches only one of these interfaces.
+ It needs some more testing to be activated though.
+ */
+ interfaces_lan_configure();
+ interfaces_wan_configure();
+ interfaces_optional_configure();
+
+ header("Location: interfaces_vlan.php");
+ exit;
+ }
}
}
OpenPOWER on IntegriCloud