diff -ur --exclude-from=/pfsense/dev/exclude /pfsense/dev/orig/gitrepo/pfSenseGITREPO/etc/inc/config.inc /pfsense/gitrepo/pfSenseGITREPO/etc/inc/config.inc --- /pfsense/dev/orig/gitrepo/pfSenseGITREPO/etc/inc/config.inc 2014-09-14 13:48:09.000000000 +0200 +++ /pfsense/gitrepo/pfSenseGITREPO/etc/inc/config.inc 2014-12-20 13:20:39.000000000 +0100 @@ -205,6 +205,15 @@ $timezone = "Etc/UTC"; date_default_timezone_set("$timezone"); +/* compatibility with older configs using vlan "tags" */ +if (($config['version'] < 11) && (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { + foreach ($config['vlans']['vlan'] as &$vlan) { + if (empty($vlan['vid']) && !empty($vlan['tag'])) { + $vlan['vid'] = $vlan['tag']; + unset($vlan['tag']); + } + } + if($config_parsed == true) { /* process packager manager custom rules */ if(is_dir("/usr/local/pkg/parse_config")) { diff -ur --exclude-from=/pfsense/dev/exclude /pfsense/dev/orig/gitrepo/pfSenseGITREPO/etc/inc/interfaces.inc /pfsense/gitrepo/pfSenseGITREPO/etc/inc/interfaces.inc --- /pfsense/dev/orig/gitrepo/pfSenseGITREPO/etc/inc/interfaces.inc 2014-09-14 13:48:10.000000000 +0200 +++ /pfsense/gitrepo/pfSenseGITREPO/etc/inc/interfaces.inc 2014-12-13 15:11:56.000000000 +0100 @@ -198,7 +198,7 @@ if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { foreach ($config['vlans']['vlan'] as $vlan) { if (empty($vlan['vlanif'])) - $vlan['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; + $vlan['vlanif'] = "{$vlan['if']}_vlan{$vlan['vid']}"; if (!empty($realif) && $realif != $vlan['vlanif']) continue; @@ -218,13 +218,14 @@ return; } $if = $vlan['if']; - $vlanif = empty($vlan['vlanif']) ? "{$if}_vlan{$vlan['tag']}" : $vlan['vlanif']; - $tag = $vlan['tag']; - if (empty($if)) { log_error(gettext("interface_vlan_configure called with if undefined.")); return; - } + } + + $vlanif = empty($vlan['vlanif']) ? "{$if}_vlan{$vlan['vid']}" : $vlan['vlanif']; + $vid = $vlan['vid']; + $pcp = empty($vlan['pcp']) ? 0 : $vlan['pcp']; /* Apply "Best Effort" if not set */ /* make sure the parent interface is up */ interfaces_bring_up($if); @@ -239,7 +240,7 @@ pfSense_ngctl_name("{$tmpvlanif}:", $vlanif); } - pfSense_vlan_create($vlanif, $if, $tag); + pfSense_vlan_create($vlanif, $if, $vid, $pcp); interfaces_bring_up($vlanif); @@ -261,7 +262,7 @@ } $qinqif = $vlan['if']; - $tag = $vlan['tag']; + $tag = $vlan['vid']; if(empty($qinqif)) { log_error(sprintf(gettext("interface_qinq_configure called with if undefined.%s"), "\n")); return; @@ -4582,7 +4583,7 @@ if ($action == "update") { interfaces_bring_up($int); } else - $ifaces[$vlan['tag']] = $vlan; + $ifaces[$vlan['vid']] = $vlan; } } if (!empty($ifaces)) diff -ur --exclude-from=/pfsense/dev/exclude /pfsense/dev/orig/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_assign.php /pfsense/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_assign.php --- /pfsense/dev/orig/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_assign.php 2014-09-14 13:48:07.000000000 +0200 +++ /pfsense/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_assign.php 2014-12-13 15:06:55.000000000 +0100 @@ -56,7 +56,7 @@ function interface_assign_description($portinfo, $portname) { global $ovpn_descrs; if ($portinfo['isvlan']) { - $descr = sprintf(gettext('VLAN %1$s on %2$s'),$portinfo['tag'],$portinfo['if']); + $descr = sprintf(gettext('VLAN %1$s on %2$s'),$portinfo['vid'],$portinfo['if']); if ($portinfo['descr']) $descr .= " (" . $portinfo['descr'] . ")"; } elseif ($portinfo['iswlclone']) { @@ -298,7 +298,7 @@ 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."; + $input_errors[] = "Vlan parent interface {$vlan['if']} does not exist anymore so vlan id {$vlan['vid']} cannot be created please fix the issue before continuing."; } } diff -ur --exclude-from=/pfsense/dev/exclude /pfsense/dev/orig/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan.php /pfsense/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan.php --- /pfsense/dev/orig/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan.php 2014-09-14 13:48:07.000000000 +0200 +++ /pfsense/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan.php 2014-12-13 15:06:55.000000000 +0100 @@ -112,8 +112,9 @@
- - + + + @@ -123,8 +124,11 @@ + diff -ur --exclude-from=/pfsense/dev/exclude /pfsense/dev/orig/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan_edit.php /pfsense/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan_edit.php --- /pfsense/dev/orig/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan_edit.php 2014-09-14 13:48:07.000000000 +0200 +++ /pfsense/gitrepo/pfSenseGITREPO/usr/local/www/interfaces_vlan_edit.php 2014-12-13 15:06:55.000000000 +0100 @@ -65,7 +65,8 @@ 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['vid'] = $a_vlans[$id]['vid']; + $pconfig['pcp'] = $a_vlans[$id]['pcp']; $pconfig['descr'] = $a_vlans[$id]['descr']; } @@ -75,59 +76,64 @@ $pconfig = $_POST; /* input validation */ - $reqdfields = explode(" ", "if tag"); - $reqdfieldsn = array(gettext("Parent interface"),gettext("VLAN tag")); + $reqdfields = explode(" ", "if vid"); + $reqdfieldsn = array(gettext("Parent interface"),gettext("VLAN")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - if ($_POST['tag'] && (!is_numericint($_POST['tag']) || ($_POST['tag'] < '1') || ($_POST['tag'] > '4094'))) { - $input_errors[] = gettext("The VLAN tag must be an integer between 1 and 4094."); + if ($_POST['vid'] && (!is_numericint($_POST['vid']) || ($_POST['vid'] < '1') || ($_POST['vid'] > '4094'))) { + $input_errors[] = gettext("The VLAN ID must be an integer between 1 and 4094."); + } + if ($_POST['pcp'] && (!is_numericint($_POST['pcp']) || ($_POST['pcp'] < '0') || ($_POST['pcp'] > '7'))) { + $input_errors[] = gettext("The VLAN Priority must be an integer between 0 and 7."); } if (!does_interface_exist($_POST['if'])) $input_errors[] = gettext("Interface supplied as parent is invalid"); if (isset($id)) { - if ($_POST['tag'] && $_POST['tag'] != $a_vlans[$id]['tag']) { - if (!empty($a_vlans[$id]['vlanif']) && convert_real_interface_to_friendly_interface_name($a_vlans[$id]['vlanif']) != NULL) - $input_errors[] = gettext("Interface is assigned and you cannot change the VLAN tag while assigned."); - } + if ($_POST['vid'] && $_POST['vid'] != $a_vlans[$id]['vid']) { + if (!empty($a_vlans[$id]['vlanif']) && convert_real_interface_to_friendly_interface_name($a_vlans[$id]['vlanif']) != NULL) + $input_errors[] = gettext("Interface is assigned and you cannot change the VLAN id while assigned."); + } } foreach ($a_vlans as $vlan) { if (isset($id) && ($a_vlans[$id]) && ($a_vlans[$id] === $vlan)) continue; - if (($vlan['if'] == $_POST['if']) && ($vlan['tag'] == $_POST['tag'])) { - $input_errors[] = sprintf(gettext("A VLAN with the tag %s is already defined on this interface."),$vlan['tag']); + if (($vlan['if'] == $_POST['if']) && ($vlan['vid'] == $_POST['vid'])) { + $input_errors[] = sprintf(gettext("A VLAN with id %s is already defined on this interface."),$vlan['vid']); break; } } if (is_array($config['qinqs']['qinqentry'])) { foreach ($config['qinqs']['qinqentry'] as $qinq) - if ($qinq['tag'] == $_POST['tag'] && $qinq['if'] == $_POST['if']) - $input_errors[] = gettext("A QinQ VLAN exists with this tag please remove it to use this tag with."); + if ($qinq['tag'] == $_POST['vid'] && $qinq['if'] == $_POST['if']) + $input_errors[] = gettext("A QinQ VLAN exists with this id please remove it to use this id with."); } if (!$input_errors) { if (isset($id) && $a_vlans[$id]) { - if (($a_vlans[$id]['if'] != $_POST['if']) || ($a_vlans[$id]['tag'] != $_POST['tag'])) { + if (($a_vlans[$id]['if'] != $_POST['if']) || ($a_vlans[$id]['vid'] != $_POST['vid'])) { if (!empty($a_vlans[$id]['vlanif'])) { $confif = convert_real_interface_to_friendly_interface_name($vlan['vlanif']); // Destroy previous vlan pfSense_interface_destroy($a_vlans[$id]['vlanif']); } else { - pfSense_interface_destroy("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['tag']}"); - $confif = convert_real_interface_to_friendly_interface_name("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['tag']}"); + pfSense_interface_destroy("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['vid']}"); + $confif = convert_real_interface_to_friendly_interface_name("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['vid']}"); } if ($confif <> "") - $config['interfaces'][$confif]['if'] = "{$_POST['if']}_vlan{$_POST['tag']}"; + $config['interfaces'][$confif]['if'] = "{$_POST['if']}_vlan{$_POST['vid']}"; } } $vlan = array(); $vlan['if'] = $_POST['if']; - $vlan['tag'] = $_POST['tag']; - $vlan['descr'] = $_POST['descr']; - $vlan['vlanif'] = "{$_POST['if']}_vlan{$_POST['tag']}"; + $vlan['vid'] = $_POST['vid']; + if ($_POST['pcp'] != '') + $vlan['pcp'] = $_POST['pcp']; /* Leave PCP unset if not required */ + $vlan['descr'] = $_POST['descr']; + $vlan['vlanif'] = "{$_POST['if']}_vlan{$_POST['vid']}"; $vlan['vlanif'] = interface_vlan_configure($vlan); if ($vlan['vlanif'] == "" || !stristr($vlan['vlanif'], "vlan")) @@ -183,13 +189,20 @@ - + + + + + +
- + + +  
- +
-
+ +
+