summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-10 15:17:22 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-05-10 13:21:59 +0000
commitbced1b4ef04f9e1a12c083c08839e4c1a54e2549 (patch)
tree9d1977454f35746adc20df4f7c1b7739f176f3b6 /python
parent82552e2abc77640b3a81560e3f8c5be2c21e3ad2 (diff)
downloadvyos-1x-bced1b4ef04f9e1a12c083c08839e4c1a54e2549.tar.gz
vyos-1x-bced1b4ef04f9e1a12c083c08839e4c1a54e2549.zip
bond: T6303: must reset system-mac to 00:00:00:00:00:00 on deletion
(cherry picked from commit 314901e7b45782fb6266b35b0e788ab7ea1404b8)
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/bond.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py
index f26426915..b8ea90049 100644
--- a/python/vyos/ifconfig/bond.py
+++ b/python/vyos/ifconfig/bond.py
@@ -449,18 +449,13 @@ class BondIf(Interface):
Interface(interface).set_admin_state('up')
# Bonding policy/mode - default value, always present
- mode = config.get('mode')
- self.set_mode(mode)
+ self.set_mode(config['mode'])
# LACPDU transmission rate - default value
- if mode == '802.3ad':
+ if config['mode'] == '802.3ad':
self.set_lacp_rate(config.get('lacp_rate'))
- # Add system mac address for 802.3ad
- if mode == '802.3ad' and 'system_mac' in config:
- self.set_system_mac(config.get('system_mac'))
-
- if mode not in ['802.3ad', 'balance-tlb', 'balance-alb']:
+ if config['mode'] not in ['802.3ad', 'balance-tlb', 'balance-alb']:
tmp = dict_search('arp_monitor.interval', config)
value = tmp if (tmp != None) else '0'
self.set_arp_interval(value)
@@ -495,6 +490,14 @@ class BondIf(Interface):
Interface(interface).flush_addrs()
self.add_port(interface)
+ # Add system mac address for 802.3ad - default address is all zero
+ # mode is always present (defaultValue)
+ if config['mode'] == '802.3ad':
+ mac = '00:00:00:00:00:00'
+ if 'system_mac' in config:
+ mac = config['system_mac']
+ self.set_system_mac(mac)
+
# Primary device interface - must be set after 'mode'
value = config.get('primary')
if value: self.set_primary(value)