diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/ethtool.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py index 22e066def..76c5b29f0 100644 --- a/python/vyos/ethtool.py +++ b/python/vyos/ethtool.py @@ -25,6 +25,10 @@ _drivers_without_speed_duplex_flow = ['vmxnet3', 'virtio_net', 'xen_netfront', 'iavf', 'ice', 'i40e', 'hv_netvsc', 'veth', 'ixgbevf', 'tun', 'vif'] +_drivers_without_mac_change = ['ena'] +# enable interface bonding will change the interface MAC address, thus all drivers +# not supporting MAC address change, also do not support bonding + class Ethtool: """ Class is used to retrive and cache information about an ethernet adapter @@ -222,3 +226,7 @@ class Ethtool: matches = re.findall(rf'{rx_tx_comb}:\s+(\d+)', self._channels) return [int(value) for value in matches] + + def check_mac_change(self) -> bool: + """ Check if ethernet drivers supports changing MAC address """ + return bool(self.get_driver_name() not in _drivers_without_mac_change) |
