From 177de5378a1e9e6983e34ef4a5244310b78d870a Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 13 Oct 2019 12:31:40 +0200 Subject: bonding: T1614: support DHCP options on VLAN interfaces --- src/conf_mode/interface-bonding.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py index c299744fe..19817da8d 100755 --- a/src/conf_mode/interface-bonding.py +++ b/src/conf_mode/interface-bonding.py @@ -84,6 +84,21 @@ def apply_vlan_config(vlan, config): if type(vlan) != type(VLANIf("lo")): raise TypeError() + # get DHCP config dictionary and update values + opt = vlan.get_dhcp_options() + + if config['dhcp_client_id']: + opt['client_id'] = config['dhcp_client_id'] + + if config['dhcp_hostname']: + opt['hostname'] = config['dhcp_hostname'] + + if config['dhcp_vendor_class_id']: + opt['vendor_class_id'] = config['dhcp_vendor_class_id'] + + # store DHCP config dictionary - used later on when addresses are aquired + vlan.set_dhcp_options(opt) + # update interface description used e.g. within SNMP vlan.set_alias(config['description']) # ignore link state changes @@ -385,8 +400,7 @@ def apply(bond): if bond['dhcp_vendor_class_id']: opt['vendor_class_id'] = bond['dhcp_vendor_class_id'] - # store DHCP config dictionary - used later on when addresses - # are requested + # store DHCP config dictionary - used later on when addresses are aquired b.set_dhcp_options(opt) # ignore link state changes -- cgit v1.2.3