Page MenuHomeVyOS Platform

bnx2x NIC causes a commit error due to incorrect implementation of EEE status reading
Closed, ResolvedPublicBUG

Description

When adding a bnx2x interface the following error is raised

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 385, in <module>
    verify(c)
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 273, in verify
    verify_ethernet(ethernet)
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 309, in verify_ethernet
    ethtool = Ethtool(ifname)
              ^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ethtool.py", line 153, in __init__
    self._eee_enabled = bool('enabled' in out.splitlines()[2])
$ sudo ethtool --show-eee eth0
EEE Settings for eth0:
        EEE status: not supported

At first I thought the bug was an out-of-bounds access, which it is in the case for bnx2x but the real bug is that the shim is reading the EEE status from the wrong line number.

Details

Difficulty level
Easy (less than an hour)
Version
1.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)