summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-03 13:50:42 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 20:58:06 +0200
commit64d3d94f35453bfaf596c27a0fc0f3fa78cc7260 (patch)
treeca78dc931d8881eba13711b16b167f644c2f3a4f
parent900e75e387939a1d1d4d5b0b79809b8bb2305b91 (diff)
downloadvyos-1x-64d3d94f35453bfaf596c27a0fc0f3fa78cc7260.tar.gz
vyos-1x-64d3d94f35453bfaf596c27a0fc0f3fa78cc7260.zip
intf_from_dict: T2241: move getting mac code so it's sorted alphabetically
-rw-r--r--python/vyos/configdict.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index ab72aac6c..97ba8937c 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -266,9 +266,6 @@ def intf_to_dict(conf, default):
if conf.exists('ipv6 disable-forwarding'):
intf['ipv6_forwarding'] = 0
- # Media Access Control (MAC) address
- if conf.exists('mac'):
- intf['mac'] = conf.return_value('mac')
# check if interface is member of a bridge
intf['is_bridge_member'] = is_member(conf, intf['intf'], 'bridge')
@@ -277,6 +274,10 @@ def intf_to_dict(conf, default):
intf['ipv6_dup_addr_detect'] = int(
conf.return_value('ipv6 dup-addr-detect-transmits'))
+ # Media Access Control (MAC) address
+ if conf.exists('mac'):
+ intf['mac'] = conf.return_value('mac')
+
# Maximum Transmission Unit (MTU)
if conf.exists('mtu'):
intf['mtu'] = int(conf.return_value('mtu'))
@@ -350,7 +351,7 @@ def intf_to_dict(conf, default):
# add the link-local by default to make IPv6 work
intf['ipv6_eui64_prefix'].append('fe80::/64')
- # Find out if MAC has changed
+ # If MAC has changed, remove and re-add all IPv6 EUI64 addresses
try:
interface = Interface(intf['intf'], create=False)
if intf['mac'] and intf['mac'] != interface.get_mac():