summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2025-03-20 16:49:46 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2025-04-14 11:50:41 +0200
commitf7c5c77376b9138d239cdccda605713b5d7681e1 (patch)
tree6d4d12413d9408868be0104928f393dbb4c17a75 /python
parentf3e77facc06750caafb100cdc6e96a1dc362182a (diff)
downloadvyos-1x-f7c5c77376b9138d239cdccda605713b5d7681e1.tar.gz
vyos-1x-f7c5c77376b9138d239cdccda605713b5d7681e1.zip
kea: T7281: Add support for ping-check in Kea
Diffstat (limited to 'python')
-rw-r--r--python/vyos/kea.py5
-rwxr-xr-xpython/vyos/template.py6
2 files changed, 9 insertions, 2 deletions
diff --git a/python/vyos/kea.py b/python/vyos/kea.py
index 264142f13..a2a35cf65 100644
--- a/python/vyos/kea.py
+++ b/python/vyos/kea.py
@@ -145,7 +145,7 @@ def kea_parse_options(config):
def kea_parse_subnet(subnet, config):
- out = {'subnet': subnet, 'id': int(config['subnet_id'])}
+ out = {'subnet': subnet, 'id': int(config['subnet_id']), 'user-context': {}}
if 'option' in config:
out['option-data'] = kea_parse_options(config['option'])
@@ -163,6 +163,9 @@ def kea_parse_subnet(subnet, config):
out['valid-lifetime'] = int(config['lease'])
out['max-valid-lifetime'] = int(config['lease'])
+ if 'ping_check' in config:
+ out['user-context']['enable-ping-check'] = True
+
if 'range' in config:
pools = []
for num, range_config in config['range'].items():
diff --git a/python/vyos/template.py b/python/vyos/template.py
index f5baf8dbd..7ba85a046 100755
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -873,7 +873,8 @@ def kea_shared_network_json(shared_networks):
network = {
'name': name,
'authoritative': ('authoritative' in config),
- 'subnet4': []
+ 'subnet4': [],
+ 'user-context': {}
}
if 'option' in config:
@@ -885,6 +886,9 @@ def kea_shared_network_json(shared_networks):
if 'bootfile_server' in config['option']:
network['next-server'] = config['option']['bootfile_server']
+ if 'ping_check' in config:
+ network['user-context']['enable-ping-check'] = True
+
if 'subnet' in config:
for subnet, subnet_config in config['subnet'].items():
if 'disable' in subnet_config: