From e635223f3dbf244e528cdfe6ae867006143052a7 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 23 Sep 2019 07:59:45 +0200 Subject: ethernet: T1637: bugfix DHCP - interface must be up prior starting DHCP client It is not possible to enable DHCP client on an interface that is down. Thus the code which enables the interface must be placed in front of assigning all interface addresses, static or DHCP. s the commit. --- src/conf_mode/interface-ethernet.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/conf_mode/interface-ethernet.py') diff --git a/src/conf_mode/interface-ethernet.py b/src/conf_mode/interface-ethernet.py index f82105847..5d597fd0a 100755 --- a/src/conf_mode/interface-ethernet.py +++ b/src/conf_mode/interface-ethernet.py @@ -316,6 +316,12 @@ def apply(eth): # Set physical interface speed and duplex e.set_speed_duplex(eth['speed'], eth['duplex']) + # Enable/Disable interface + if eth['disable']: + e.state = 'down' + else: + e.state = 'up' + # Configure interface address(es) # - not longer required addresses get removed first # - newly addresses will be added second @@ -324,12 +330,6 @@ def apply(eth): for addr in eth['address']: e.add_addr(addr) - # Enable/Disable interface - if eth['disable']: - e.state = 'down' - else: - e.state = 'up' - # remove no longer required service VLAN interfaces (vif-s) for vif_s in eth['vif_s_remove']: e.del_vlan(vif_s) -- cgit v1.2.3