From 64d3d94f35453bfaf596c27a0fc0f3fa78cc7260 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sun, 3 May 2020 13:50:42 +0200 Subject: intf_from_dict: T2241: move getting mac code so it's sorted alphabetically --- python/vyos/configdict.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'python') 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(): -- cgit v1.2.3