summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-bridge.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-04-22 18:03:55 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-04-23 16:09:38 +0200
commit2d1dddd1b381676743dc602a321f2fd3146adc08 (patch)
tree7836093ddec5f3f008ca66a49539a37fe5a1e4a7 /src/conf_mode/interfaces-bridge.py
parentc6997f0ca98c628dd85f1789ce53e495e9a451bc (diff)
downloadvyos-1x-2d1dddd1b381676743dc602a321f2fd3146adc08.tar.gz
vyos-1x-2d1dddd1b381676743dc602a321f2fd3146adc08.zip
interfaces: bridge: T2362: correct order of adding/deleting EUI64 addresses
Diffstat (limited to 'src/conf_mode/interfaces-bridge.py')
-rwxr-xr-xsrc/conf_mode/interfaces-bridge.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/conf_mode/interfaces-bridge.py b/src/conf_mode/interfaces-bridge.py
index da49415f7..2f92aae09 100755
--- a/src/conf_mode/interfaces-bridge.py
+++ b/src/conf_mode/interfaces-bridge.py
@@ -336,17 +336,10 @@ def apply(bridge):
br.set_vrf(bridge['vrf'])
# Delete old IPv6 EUI64 addresses before changing MAC
+ # (adding members to a fresh bridge changes its MAC too)
for addr in bridge['ipv6_eui64_prefix_remove']:
br.del_ipv6_eui64_address(addr)
- # Change interface MAC address
- if bridge['mac']:
- br.set_mac(bridge['mac'])
-
- # Add IPv6 EUI-based addresses
- for addr in bridge['ipv6_eui64_prefix']:
- br.add_ipv6_eui64_address(addr)
-
# remove interface from bridge
for intf in bridge['member_remove']:
br.del_port(intf)
@@ -355,6 +348,15 @@ def apply(bridge):
for member in bridge['member']:
br.add_port(member['name'])
+ # Change interface MAC address
+ if bridge['mac']:
+ br.set_mac(bridge['mac'])
+
+ # Add IPv6 EUI-based addresses (must be done after adding the
+ # 1st bridge member or setting its MAC)
+ for addr in bridge['ipv6_eui64_prefix']:
+ br.add_ipv6_eui64_address(addr)
+
# up/down interface
if bridge['disable']:
br.set_admin_state('down')