Port Admin may not work properly for any non-HP and non-Cisco device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
High
|
Unassigned |
Bug Description
While investigating a strange Django traceback I received from one customer installation of NAV 4.2, I found some code in Port Admin that seems to do "the wrong thing"™.
The traceback looks like this:
Traceback:
File "/usr/lib/
109. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/
467. interface)
File "/usr/lib/
345. if bitvector[
File "/usr/lib/
71. return (self.vector[block] << shift) & 128 and 1 or 0
Exception Type: IndexError at /portadmin/
Exception Value: array index out of range
Looking at the code referred in the traceback, it seems it assumes that objects of the PortList Textual Convention retrieved from Q-BRIDGE-MIB refer to interface indexes (ifIndex). This is _wrong_. The port numbers from a PortList type object are baseport numbers from the BRIDGE-MIB. The mapping from baseport numbers to interface indexes can be found in the BRIDGE-
It just so happens that many HP devices map baseport numbers and interface indexes one-to-one, so this code happens to work by chance on HP devices. It will likely faily on other vendors that support writing to the Q-BRIDGE-MIB, and also on any HP device that does not number interface indexes and baseport numbers the same.
This should be investigated, the code fixed and tested on both HP devices and some other vendors that support Q-BRIDGE-MIB.
Changed in nav: | |
status: | Fix Committed → Fix Released |
Fix here: /nav.uninett. no/hg/default/ rev/dcf39e802b5 e
https:/