From 2d3539f9dec19c0d5cec5bd962aaf9640a8cec23 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 8 Oct 2019 21:39:45 +0200 Subject: T1430: add dhcp vendor-class-id client option --- src/conf_mode/interface-ethernet.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (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 5f9b4d8b0..3cdc03ce5 100755 --- a/src/conf_mode/interface-ethernet.py +++ b/src/conf_mode/interface-ethernet.py @@ -31,6 +31,7 @@ default_config_data = { 'deleted': False, 'dhcp_client_id': '', 'dhcp_hostname': '', + 'dhcp_vendor_class_id': '', 'dhcpv6_prm_only': False, 'dhcpv6_temporary': False, 'disable': False, @@ -75,6 +76,9 @@ def apply_vlan_config(vlan, config): 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 requested vlan.set_dhcp_options(opt) @@ -147,6 +151,10 @@ def get_config(): if conf.exists('dhcp-options host-name'): eth['dhcp_hostname'] = conf.return_value('dhcp-options host-name') + # DHCP client vendor identifier + if conf.exists('dhcp-options vendor-class-id'): + eth['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'): eth['dhcpv6_prm_only'] = conf.return_value('dhcpv6-options parameters-only') @@ -295,6 +303,9 @@ def apply(eth): if eth['dhcp_hostname']: opt['hostname'] = eth['dhcp_hostname'] + if eth['dhcp_vendor_class_id']: + opt['vendor_class_id'] = eth['dhcp_vendor_class_id'] + # store DHCP config dictionary - used later on when addresses # are requested e.set_dhcp_options(opt) -- cgit v1.2.3