summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-ethernet.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-31 18:15:47 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-31 19:04:15 +0200
commit2bfd809e9ae198d95b9fcb556440637fdcc4005c (patch)
treeb3ed201903dc0a649888e40a7521036b2d235105 /src/conf_mode/interfaces-ethernet.py
parent031817eecb14280e3f421cb9c391ab29dbc2fa60 (diff)
downloadvyos-1x-2bfd809e9ae198d95b9fcb556440637fdcc4005c.tar.gz
vyos-1x-2bfd809e9ae198d95b9fcb556440637fdcc4005c.zip
ethernet: T2241: check if interface supports changing speed/duplex settings
Not all interface drivers have the ability to change the speed and duplex settings. Known drivers with this limitation are vmxnet3, virtio_net and xen_netfront. If this driver is detected, an error will be presented to the user. (cherry picked from commit cc742d48579e4f76e5d3230d87e22f71f76f9301)
Diffstat (limited to 'src/conf_mode/interfaces-ethernet.py')
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index a7e01e279..57e05d4ea 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -75,7 +75,8 @@ def verify(ethernet):
speed = ethernet['speed']
duplex = ethernet['duplex']
if not ethtool.check_speed_duplex(speed, duplex):
- raise ConfigError(f'Adapter does not support speed "{speed}" and duplex "{duplex}"!')
+ raise ConfigError(f'Adapter does not support changing speed and duplex '\
+ f'settings to: {speed}/{duplex}!')
if 'ring_buffer' in ethernet:
max_rx = ethtool.get_rx_buffer()