diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-09-10 16:45:30 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-09-10 16:45:30 +0200 |
commit | 1572edd2cef355710d1129907d3e49451a6c31d4 (patch) | |
tree | c47ff092e6dc8c06e2ecf26802f404fddf25c940 /python/vyos | |
parent | ab75b9bca0fca8ed2929e77f1274a0c9c7c08d90 (diff) | |
download | vyos-1x-1572edd2cef355710d1129907d3e49451a6c31d4.tar.gz vyos-1x-1572edd2cef355710d1129907d3e49451a6c31d4.zip |
ethernet: T3802: check if driver supports changing flow-control settings
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ethtool.py | 2 | ||||
-rw-r--r-- | python/vyos/ifconfig/ethernet.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py index 609d83b5e..7e46969cf 100644 --- a/python/vyos/ethtool.py +++ b/python/vyos/ethtool.py @@ -46,7 +46,7 @@ class Ethtool: _ring_buffers_max = { } _driver_name = None _auto_negotiation = None - _flow_control = None + _flow_control = False _flow_control_enabled = None def __init__(self, ifname): diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index cb07693c3..47d3b6b4d 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -116,11 +116,10 @@ class EthernetIf(Interface): if enable not in ['on', 'off']: raise ValueError("Value out of range") - driver_name = self.get_driver_name() - if driver_name in ['vmxnet3', 'virtio_net', 'xen_netfront']: + if not self.ethtool.check_flow_control(): self._debug_msg(f'{driver_name} driver does not support changing '\ 'flow control settings!') - return + return False current = self.ethtool.get_flow_control() if current != enable: |