subtracting 1 from the $port_id value in the egress_ids loop

This is to fix an off by one error.
The ERS reports VLAN membership using a bitmask, but the MSB is always 0.
So using the `q_bridge_bits2indices` function results in the reported ports membership being +1 wrong.
The best fix for this would be to create a new function exactly the same as `q_bridge_bits2indices` which subtracts the 1 before returning the array. 
I tried this, but it broke my install :)
Not sure how to add to the `functions.inc.php` file without breaking it.
This commit is contained in:
Tom Sealey
2017-08-01 11:20:27 +01:00
committed by GitHub
parent 01fca2ebd5
commit 52f1b53a05

View File

@ -35,8 +35,8 @@ if ($device['os'] == 'avaya-ers') {
}
foreach ($egress_ids as $port_id) {
$ifIndex = $base_to_index[$port_id];
$per_vlan_data[$vlan_id][$ifIndex]['untagged'] = (in_array($port_id, $untagged_ids) ? 1 : 0);
$ifIndex = $base_to_index[$port_id - 1]; // -1 fixes off by one error
$per_vlan_data[$vlan_id][$ifIndex]['untagged'] = (in_array($port_id - 1, $untagged_ids) ? 1 : 0); // -1 fixes off by one error
}
}
}