From 735a7d663c279e25feadcfad79e17be7fc0d8c8f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 8 Sep 2019 19:53:49 +0200 Subject: ethernet: T1637: reset MAC address to read hw-id on removal --- src/conf_mode/interface-ethernet.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/interface-ethernet.py b/src/conf_mode/interface-ethernet.py index c20e551d6..83459cedb 100755 --- a/src/conf_mode/interface-ethernet.py +++ b/src/conf_mode/interface-ethernet.py @@ -140,6 +140,10 @@ def get_config(): if conf.exists('disable-link-detect'): eth['disable_link_detect'] = 2 + # retrieve real hardware address + if conf.exists('hw-id'): + eth['hw_id'] = conf.return_value('hw-id') + # disable interface if conf.exists('disable'): eth['disable'] = True @@ -235,9 +239,12 @@ def apply(eth): # Enable private VLAN proxy ARP on this interface e.proxy_arp_pvlan = eth['ip_proxy_arp_pvlan'] - # Change interface MAC address + # Change interface MAC address - re-set to real hardware address (hw-id) + # if custom mac is removed if eth['mac']: e.mac = eth['mac'] + else: + e.mac = eth['hw_id'] # Maximum Transmission Unit (MTU) e.mtu = eth['mtu'] -- cgit v1.2.3