mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user