diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-09-04 11:39:01 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-09-04 11:43:48 +0200 |
commit | 5548dee213dc14b83322bfdcf32d089f5cb169eb (patch) | |
tree | 44a70a3000f50152e28556b40a2f1a31fc58f2be /src/op_mode/show_interfaces.py | |
parent | 537cd313d0076008e66fde728576ad328bfc0dcc (diff) | |
download | vyos-1x-5548dee213dc14b83322bfdcf32d089f5cb169eb.tar.gz vyos-1x-5548dee213dc14b83322bfdcf32d089f5cb169eb.zip |
op-mode: T3619: bugfix "show interfaces" for VLANs
Commit 31169fa8a7 ("vyos.ifconfig: T3619: only set offloading options if
supported by NIC") always instantiated an object of the Ethtool class for an
ethernet object - this is right as a real ethernet interface is managed by
Ethtool.
Unfortunately the script used for "show interface" determindes the "base class"
for an interface by its name, so eth0 -> Ethernet, eth0.10 -> Ethernet. This
assumption is incorrect as a VLAN interface can not have the physical parameters
changed of its underlaying interface. This can only be done for eth0.
There is no need for the op-mode script to determine the implementation class
for an interface at this level, as we are only interested in the state of the
interface and it's IP addresses - which is a common operation valid for every
interface on VyOS.
(cherry picked from commit 27e53fbcd843c3aad27db9e97f9060ae6dfcc5ee)
Diffstat (limited to 'src/op_mode/show_interfaces.py')
-rwxr-xr-x | src/op_mode/show_interfaces.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/op_mode/show_interfaces.py b/src/op_mode/show_interfaces.py index bfb5d68a2..17b52b5df 100755 --- a/src/op_mode/show_interfaces.py +++ b/src/op_mode/show_interfaces.py @@ -60,10 +60,9 @@ def filtered_interfaces(ifnames, iftypes, vif, vrrp): if ifnames and ifname not in ifnames: continue - # return the class which can handle this interface name - klass = Section.klass(ifname) - # connect to the interface - interface = klass(ifname, create=False, debug=False) + # As we are only "reading" from the interface - we must use the + # generic base class which exposes all the data via a common API + interface = Interface(ifname, create=False, debug=False) if iftypes and interface.definition['section'] not in iftypes: continue |