From 41d56f9cc0cbf3ab7b893e9f686b8adbc85f8b63 Mon Sep 17 00:00:00 2001 From: Patrick Felt Date: Wed, 25 Mar 2026 06:53:05 +0000 Subject: kea: T8408: Fixes to enable dhcp option 67 - Kea overloads the meaning of the boot-file-name option. When used on its own, it represents the legacy bootp filename option. When option 67 is needed, boot-file-name must be included in an options block. --- python/vyos/kea.py | 13 +++++++++++++ python/vyos/template.py | 1 + 2 files changed, 14 insertions(+) (limited to 'python') diff --git a/python/vyos/kea.py b/python/vyos/kea.py index a8b38d999..733e7cf86 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -165,6 +165,7 @@ def kea_parse_subnet(subnet, config): if 'bootfile_name' in config['option']: out['boot-file-name'] = config['option']['bootfile_name'] + out['option-data'].append({"name": "boot-file-name", "data": config['option']['bootfile_name']}) if 'bootfile_server' in config['option']: out['next-server'] = config['option']['bootfile_server'] @@ -193,6 +194,12 @@ def kea_parse_subnet(subnet, config): if 'bootfile_name' in range_config['option']: pool['boot-file-name'] = range_config['option']['bootfile_name'] + pool['option-data'].append( + { + "name": "boot-file-name", + "data": range_config['option']['bootfile_name'] + } + ) if 'bootfile_server' in range_config['option']: pool['next-server'] = range_config['option']['bootfile_server'] @@ -229,6 +236,12 @@ def kea_parse_subnet(subnet, config): reservation['boot-file-name'] = host_config['option'][ 'bootfile_name' ] + reservation['option-data'].append( + { + "name": "boot-file-name", + "data": host_config['option']['bootfile_name'] + } + ) if 'bootfile_server' in host_config['option']: reservation['next-server'] = host_config['option'][ diff --git a/python/vyos/template.py b/python/vyos/template.py index 2a783bc74..d2fb5c1e0 100755 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -1031,6 +1031,7 @@ def kea_shared_network_json(shared_networks): if 'bootfile_name' in config['option']: network['boot-file-name'] = config['option']['bootfile_name'] + network['option-data'].append({"name": "boot-file-name", "data": config['option']['bootfile_name']}) if 'bootfile_server' in config['option']: network['next-server'] = config['option']['bootfile_server'] -- cgit v1.2.3 From 1c0de22b735fc398975b218b601f0d209a9985a0 Mon Sep 17 00:00:00 2001 From: Patrick Felt Date: Wed, 25 Mar 2026 22:27:00 +0000 Subject: kea: T8408: Fixes to enable dhcp option 67 - update dict literal style --- python/vyos/kea.py | 10 +++++----- python/vyos/template.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'python') diff --git a/python/vyos/kea.py b/python/vyos/kea.py index 733e7cf86..c692dcac0 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -165,7 +165,7 @@ def kea_parse_subnet(subnet, config): if 'bootfile_name' in config['option']: out['boot-file-name'] = config['option']['bootfile_name'] - out['option-data'].append({"name": "boot-file-name", "data": config['option']['bootfile_name']}) + out['option-data'].append({'name': 'boot-file-name', 'data': config['option']['bootfile_name']}) if 'bootfile_server' in config['option']: out['next-server'] = config['option']['bootfile_server'] @@ -196,8 +196,8 @@ def kea_parse_subnet(subnet, config): pool['boot-file-name'] = range_config['option']['bootfile_name'] pool['option-data'].append( { - "name": "boot-file-name", - "data": range_config['option']['bootfile_name'] + 'name': 'boot-file-name', + 'data': range_config['option']['bootfile_name'] } ) @@ -238,8 +238,8 @@ def kea_parse_subnet(subnet, config): ] reservation['option-data'].append( { - "name": "boot-file-name", - "data": host_config['option']['bootfile_name'] + 'name': 'boot-file-name', + 'data': host_config['option']['bootfile_name'] } ) diff --git a/python/vyos/template.py b/python/vyos/template.py index d2fb5c1e0..d72479c85 100755 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -1031,7 +1031,7 @@ def kea_shared_network_json(shared_networks): if 'bootfile_name' in config['option']: network['boot-file-name'] = config['option']['bootfile_name'] - network['option-data'].append({"name": "boot-file-name", "data": config['option']['bootfile_name']}) + network['option-data'].append({'name': 'boot-file-name', 'data': config['option']['bootfile_name']}) if 'bootfile_server' in config['option']: network['next-server'] = config['option']['bootfile_server'] -- cgit v1.2.3 From 76e4cc7656fa339b5ca7797aa5148c4f62be9ab8 Mon Sep 17 00:00:00 2001 From: Patrick Felt Date: Thu, 26 Mar 2026 08:02:44 +0000 Subject: kea: T8408: Fixes to enable dhcp option 67 - convert to the simpler kea4_options dict - add the smoketest --- python/vyos/kea.py | 14 +------------- python/vyos/template.py | 1 - smoketest/scripts/cli/test_service_dhcp-server.py | 5 +++++ 3 files changed, 6 insertions(+), 14 deletions(-) (limited to 'python') diff --git a/python/vyos/kea.py b/python/vyos/kea.py index c692dcac0..c49292033 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -47,6 +47,7 @@ kea4_options = { 'captive_portal': 'v4-captive-portal', 'capwap_controller': 'capwap-ac-v4', 'interface_mtu': 'interface-mtu', + 'bootfile_name': 'boot-file-name' } kea6_options = { @@ -165,7 +166,6 @@ def kea_parse_subnet(subnet, config): if 'bootfile_name' in config['option']: out['boot-file-name'] = config['option']['bootfile_name'] - out['option-data'].append({'name': 'boot-file-name', 'data': config['option']['bootfile_name']}) if 'bootfile_server' in config['option']: out['next-server'] = config['option']['bootfile_server'] @@ -194,12 +194,6 @@ def kea_parse_subnet(subnet, config): if 'bootfile_name' in range_config['option']: pool['boot-file-name'] = range_config['option']['bootfile_name'] - pool['option-data'].append( - { - 'name': 'boot-file-name', - 'data': range_config['option']['bootfile_name'] - } - ) if 'bootfile_server' in range_config['option']: pool['next-server'] = range_config['option']['bootfile_server'] @@ -236,12 +230,6 @@ def kea_parse_subnet(subnet, config): reservation['boot-file-name'] = host_config['option'][ 'bootfile_name' ] - reservation['option-data'].append( - { - 'name': 'boot-file-name', - 'data': host_config['option']['bootfile_name'] - } - ) if 'bootfile_server' in host_config['option']: reservation['next-server'] = host_config['option'][ diff --git a/python/vyos/template.py b/python/vyos/template.py index d72479c85..2a783bc74 100755 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -1031,7 +1031,6 @@ def kea_shared_network_json(shared_networks): if 'bootfile_name' in config['option']: network['boot-file-name'] = config['option']['bootfile_name'] - network['option-data'].append({'name': 'boot-file-name', 'data': config['option']['bootfile_name']}) if 'bootfile_server' in config['option']: network['next-server'] = config['option']['bootfile_server'] diff --git a/smoketest/scripts/cli/test_service_dhcp-server.py b/smoketest/scripts/cli/test_service_dhcp-server.py index 285b56dfe..d778f9c33 100755 --- a/smoketest/scripts/cli/test_service_dhcp-server.py +++ b/smoketest/scripts/cli/test_service_dhcp-server.py @@ -381,6 +381,11 @@ class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase): ) # Verify options + self.verify_config_object( + obj, + ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'option-data'], + {'name': 'boot-file-name', 'data': bootfile_name}, + ) self.verify_config_object( obj, ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'option-data'], -- cgit v1.2.3 From d0324c6487ba638130989e78e102014e4dccf644 Mon Sep 17 00:00:00 2001 From: Patrick Felt Date: Thu, 26 Mar 2026 08:22:35 +0000 Subject: kea: T8408: Fixes to enable dhcp option 67 - fix darker linter --- python/vyos/kea.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/kea.py b/python/vyos/kea.py index c49292033..9a7e22e1e 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -47,7 +47,7 @@ kea4_options = { 'captive_portal': 'v4-captive-portal', 'capwap_controller': 'capwap-ac-v4', 'interface_mtu': 'interface-mtu', - 'bootfile_name': 'boot-file-name' + 'bootfile_name': 'boot-file-name', } kea6_options = { -- cgit v1.2.3