diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-11-28 10:47:30 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-11-28 10:47:30 +0000 |
commit | 4400ad66dca98efa3bbd5d4935cc6ff821eece8b (patch) | |
tree | 66fff20bb549de7e5428baa322a158fcef90bd77 /usr/local/www | |
parent | a726c0e83af3313c797726cdff3f3fd727467a78 (diff) | |
download | pfsense-4400ad66dca98efa3bbd5d4935cc6ff821eece8b.zip pfsense-4400ad66dca98efa3bbd5d4935cc6ff821eece8b.tar.gz |
Rework qinq a bit. Make it use a vlan(4) as the firt Q and a ng_vlan(4) for the second Q in QinQ.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/interfaces_qinq.php | 8 | ||||
-rwxr-xr-x | usr/local/www/interfaces_qinq_edit.php | 24 |
2 files changed, 15 insertions, 17 deletions
diff --git a/usr/local/www/interfaces_qinq.php b/usr/local/www/interfaces_qinq.php index b285fd9..84be902 100755 --- a/usr/local/www/interfaces_qinq.php +++ b/usr/local/www/interfaces_qinq.php @@ -68,10 +68,10 @@ if ($_GET['act'] == "del") { $delmembers = explode(" ", $qinq['members']); if (count($delmembers) > 0) { foreach ($delmembers as $tag) - mwexec("/usr/sbin/ngctl shutdown vlan{$qinq['tag']}h{$tag}:"); + mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}h{$tag}:"); } - mwexec("/usr/sbin/ngctl shutdown vlanh{$qinq['tag']}:"); - mwexec("/usr/sbin/ngctl shutdown {$qinq['if']}qinq:"); + mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}qinq:"); + mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}:"); unset($a_qinqs[$id]); write_config(); @@ -127,7 +127,7 @@ include("head.inc"); <td class="listr"> <?php if (strlen($qinq['members']) > 20) - echo substr(htmlspecialchars($qinq['members']), 1, 20) . "..."; + echo substr(htmlspecialchars($qinq['members']), 0, 20) . "..."; else echo htmlspecialchars($qinq['members']); ?> diff --git a/usr/local/www/interfaces_qinq_edit.php b/usr/local/www/interfaces_qinq_edit.php index 8e6a900..9612aee0 100755 --- a/usr/local/www/interfaces_qinq_edit.php +++ b/usr/local/www/interfaces_qinq_edit.php @@ -143,7 +143,7 @@ if ($_POST) { if (!$input_errors) { $qinqentry['members'] = $members; $qinqentry['descr'] = mb_convert_encoding($_POST['descr'],"HTML-ENTITIES","auto"); - $qinqentry['vlanif'] = "vlan{$_POST['tag']}"; + $qinqentry['vlanif'] = "{$_POST['if']}_{$_POST['tag']}"; $nmembers = explode(" ", $members); if (isset($id) && $a_qinqs[$id]) { @@ -151,21 +151,19 @@ if ($_POST) { $delmembers = array_diff($omembers, $nmembers); if (count($delmembers) > 0) { foreach ($delmembers as $tag) { - mwexec("/usr/sbin/ngctl shutdown vlan{$_POST['tag']}h{$tag}:"); - mwexec("/usr/sbin/ngctl msg vlan{$_POST['tag']}qinq: delfilter \\\"vlan{$_POST['tag']}{$tag}\\\""); + mwexec("/usr/sbin/ngctl shutdown {$qinqentry['vlanif']}h{$tag}:"); + mwexec("/usr/sbin/ngctl msg {$qinqentry['vlanif']}qinq: delfilter \\\"{$qinqentry['vlanif']}{$tag}\\\""); } } $addmembers = array_diff($nmembers, $omembers); if (count($addmembers) > 0) { foreach ($addmembers as $member) { - $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}"); + $macaddr = get_interface_mac($qinqentry['vlanif']); + mwexec("/usr/sbin/ngctl mkpeer {$$qinqentry['vlanif']}qinq: eiface {$$qinqentry['vlanif']}{$member} ether"); + mwexec("/usr/sbin/ngctl name {$qinqentry['vlanif']}qinq:{$qinqentry['vlanif']}{$tag} {$qinqentry['vlanif']}h{$member}"); + mwexec("/usr/sbin/ngctl msg {$qinqentry['vlanif']}qinq: addfilter '{ vlan={$member} hook=\\\"{$qinqentry['vlanif']}{$member}\\\" }'"); + mwexec("/usr/sbin/ngctl msg {$qinqentry['vlanif']}h{$tag}: setifname \\\"{$qinqentry['vlanif']}_{$member}\\\""); + mwexec("/usr/sbin/ngctl msg {$qinqentry['vlanif']}h{$member}: set {$macaddr}"); } } $a_qinqs[$id] = $qinqentry; @@ -184,8 +182,8 @@ if ($_POST) { } $additions = ""; foreach($nmembers as $qtag) - $additions .= "vlan{$qinqentry['tag']}_{$qtag} "; - $additions .= "vlan{$qinqentry['tag']} "; + $additions .= "{$qinqentry['vlanif']}_{$qtag} "; + $additions .= "{$qinqentry['vlanif']}"; if ($found == true) $config['ifgroups']['ifgroupentry'][$gid]['members'] .= " {$additions}"; else { |