Page MenuHomePhabricator

`show snmp mib ifmib` crashed
Needs testing, Requires assessmentPublic

Description

After run command show snmp mib ifmib and lspci not returned values script crashed

lo:     ifIndex = 1
        ifAlias = lo
        ifDescr = lo
eth0:   ifIndex = 2
        ifAlias = OUTSIDE
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/snmp_ifmib.py", line 126, in <module>
    print('\t{0}'.format(show_ifdescr(i)))
  File "/usr/libexec/vyos/op_mode/snmp_ifmib.py", line 82, in show_ifdescr
    vendor = string[3]
IndexError: list index out of range

Returned values

sudo cat /sys/class/net/eth0/device/vendor
 0x1af4
sudo cat /sys/class/net/eth0/device/device
0x0001
/usr/bin/lspci -mm -d 0x1af4:0x0001

needs add additional check

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

Dmitry created this task.Aug 10 2019, 7:42 PM
Dmitry created this object in space S1 VyOS Public.
Dmitry updated the task description. (Show Details)
Dmitry changed the task status from Open to Needs testing.Thu, Nov 28, 12:27 PM
Dmitry claimed this task.
Dmitry set Is it a breaking change? to Perfectly compatible.

This patch successfully tested on VyOS 1.2.3

vyos@vyos# run show snmp mib ifmib 
lo:     ifIndex = 1
        ifAlias = lo
        ifDescr = lo
eth0:   ifIndex = 2
        ifAlias = eth0
        ifDescr =  
eth1:   ifIndex = 3
        ifAlias = eth1
        ifDescr =  
eth2:   ifIndex = 4
        ifAlias = eth2
        ifDescr =  
eth3:   ifIndex = 5
        ifAlias = eth3
        ifDescr =
pasik added a subscriber: pasik.Sat, Nov 30, 10:26 AM