summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-04-04 23:18:14 +0000
committerErmal Luçi <eri@pfsense.org>2009-04-04 23:18:14 +0000
commit5155bb33020d786ac490ce660edebaa6d18e0b09 (patch)
treeccebdf4d03d2b7d2bd198949b816727a0e68b3b6
parentc1289cfd78dcabf4eac1f80c36bd216f81f754ca (diff)
downloadpfsense-5155bb33020d786ac490ce660edebaa6d18e0b09.zip
pfsense-5155bb33020d786ac490ce660edebaa6d18e0b09.tar.gz
Optimize adding new members to QinQ to evitate recreating the whole QinQ members.
-rwxr-xr-xusr/local/www/interfaces_qinq_edit.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/local/www/interfaces_qinq_edit.php b/usr/local/www/interfaces_qinq_edit.php
index 6829d9a..bb13c62 100755
--- a/usr/local/www/interfaces_qinq_edit.php
+++ b/usr/local/www/interfaces_qinq_edit.php
@@ -155,10 +155,14 @@ if ($_POST) {
$addmembers = array_diff($nmembers, $omembers);
if (count($addmembers) > 0) {
foreach ($addmembers as $member) {
- $vlan = array();
- $vlan['if'] = "vlan{$_POST['tag']}";
- $vlan['tag'] = $member;
- interface_qinq2_configure($vlan);
+ $if = "vlan{$_POST['tag']}";
+ $vlanif = "{$if}_{$member}";
+ $macaddr = get_interface_mac($if);
+ mwexec("/usr/sbin/ngctl mkpeer {$if}qinq: eiface {$if}{$member} ether");
+ mwexec("/usr/sbin/ngctl name {$if}qinq:{$if}{$tag} {$if}h{$member}");
+ mwexec("/usr/sbin/ngctl msg {$if}qinq: addfilter '{ vlan={$member} hook=\\\"{$if}{$member}\\\" }'");
+ mwexec("/usr/sbin/ngctl msg {$if}h{$tag}: setifname \\\"{$vlanif}\\\"");
+ mwexec("/usr/sbin/ngctl msg {$vlanif}: setenaddr {$macaddr}");
}
}
$a_qinqs[$id] = $qinqentry;
OpenPOWER on IntegriCloud