mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
Interfaces/Other Types/VLAN - outer vlan should be marked "ad", inner is always "q". closes https://github.com/opnsense/core/issues/5893
This commit is contained in:
parent
7fa6fbbc5d
commit
d8f209420d
@ -154,11 +154,14 @@ function interfaces_vlan_configure($verbose = false)
|
||||
$all_parents = [];
|
||||
foreach ($config['vlans']['vlan'] as $vlan) {
|
||||
if (!in_array($vlan['vlanif'], $all_parents)) {
|
||||
$all_parents[] = $vlan['vlanif'];
|
||||
if (!isset($all_parents[$vlan['if']])) {
|
||||
$all_parents[$vlan['if']] = 0;
|
||||
}
|
||||
$all_parents[$vlan['if']]++ ;
|
||||
}
|
||||
}
|
||||
foreach ($config['vlans']['vlan'] as $vlan) {
|
||||
$vlan['proto'] = !in_array($vlan['if'], $all_parents) ? '802.1q' : '802.1ad';
|
||||
$vlan['proto'] = empty($all_parents[$vlan['vlanif']]) ? '802.1q' : '802.1ad';
|
||||
_interfaces_vlan_configure($vlan);
|
||||
}
|
||||
|
||||
|
||||
@ -54,9 +54,10 @@ if (file_exists($vfilename) && filesize($vfilename) > 0) {
|
||||
if (!empty($config['vlans']['vlan'])) {
|
||||
foreach ($config['vlans']['vlan'] as $vlan) {
|
||||
$all_vlans[$vlan['vlanif']] = $vlan;
|
||||
if (!in_array($vlan['vlanif'], $all_parents)) {
|
||||
$all_parents[] = $vlan['vlanif'];
|
||||
if (!isset($all_parents[$vlan['if']])) {
|
||||
$all_parents[$vlan['if']] = 0;
|
||||
}
|
||||
$all_parents[$vlan['if']]++ ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +68,7 @@ foreach (legacy_interfaces_details() as $ifname => $ifdetails) {
|
||||
}
|
||||
if (isset($all_vlans[$ifname])) {
|
||||
$vlan = $all_vlans[$ifname];
|
||||
$vlan['proto'] = !in_array($vlan['if'], $all_parents) ? '802.1q' : '802.1ad';
|
||||
$vlan['proto'] = empty($all_parents[$vlan['vlanif']]) ? '802.1q' : '802.1ad';
|
||||
$cvlan = $ifdetails['vlan'];
|
||||
if (empty($vlan)) {
|
||||
// option 1: removed vlan
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user