[SNMP-12] MibTable assumes Enum values start from 0 Created: 04/Apr/16 Updated: 19/Oct/17 |
|
| Status: | In Review |
| Project: | snmp |
| Component/s: | General |
| Affects Version/s: | unspecified |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Romanos Skiadas | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 5650 |
| Description |
|
The MibTable class assumes that Enums start from 0 which is is not always true and causes problems. > leaf ifAdminStatus { > enum down { value 2; }> enum testing { value 3; }> } This is the relevant snippet from the MibTable class: > } else if (Enum.class.isAssignableFrom(objectType)) { getEnumConstants returns an array like [up, down, testing], however variable.toInt() ranges from 1 to 3. [up, down, testing][1] => down If ifAdminStatus is testing, you get [up, down, testing][3] which causes an exception: >2016-04-04 12:17:47,386 | WARN | tp1045961511-266 | MibTable | 242 - org.opendaylight.snmp - 1.1.0.Beryllium | Populate Exception The correct code should shift variable.toInt() accordingly to account for this. Right now I am working on fixing this. |
| Comments |
| Comment by Abbas P Pareedkunju [ 31/May/16 ] |
|
Hi, Is it ok if I start working on this? Thanks, |
| Comment by Romanos Skiadas [ 31/May/16 ] |
|
(In reply to Abbas P Pareedkunju from comment #1) I've already submitted a pull request to fix it |
| Comment by Abbas P Pareedkunju [ 31/May/16 ] |
|
Thanks to confirm Romanos. |