summaryrefslogtreecommitdiff
path: root/src/conf_mode/interface-bonding.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/interface-bonding.py')
-rwxr-xr-xsrc/conf_mode/interface-bonding.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py
index 4d5009c73..49d2a05d4 100755
--- a/src/conf_mode/interface-bonding.py
+++ b/src/conf_mode/interface-bonding.py
@@ -34,6 +34,7 @@ default_config_data = {
'deleted': False,
'dhcp_client_id': '',
'dhcp_hostname': '',
+ 'dhcp_vendor_class_id': '',
'dhcpv6_prm_only': False,
'dhcpv6_temporary': False,
'disable': False,
@@ -164,6 +165,10 @@ def get_config():
if conf.exists('dhcp-options host-name'):
bond['dhcp_hostname'] = conf.return_value('dhcp-options host-name')
+ # DHCP client vendor identifier
+ if conf.exists('dhcp-options vendor-class-id'):
+ bond['dhcp_vendor_class_id'] = conf.return_value('dhcp-options vendor-class-id')
+
# DHCPv6 only acquire config parameters, no address
if conf.exists('dhcpv6-options parameters-only'):
bond['dhcpv6_prm_only'] = conf.return_value('dhcpv6-options parameters-only')
@@ -368,9 +373,21 @@ def apply(bond):
# update interface description used e.g. within SNMP
b.set_alias(bond['description'])
- #
- # missing DHCP/DHCPv6 options go here
- #
+ # get DHCP config dictionary and update values
+ opt = b.get_dhcp_options()
+
+ if bond['dhcp_client_id']:
+ opt['client_id'] = bond['dhcp_client_id']
+
+ if bond['dhcp_hostname']:
+ opt['hostname'] = bond['dhcp_hostname']
+
+ 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
+ b.set_dhcp_options(opt)
# ignore link state changes
b.set_link_detect(bond['disable_link_detect'])