diff options
| author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2025-11-20 15:20:44 +0100 |
|---|---|---|
| committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2025-11-20 15:28:17 +0100 |
| commit | 3ca132fe22f732a7d4191e7e1c1d2b00d4206690 (patch) | |
| tree | b35c5f8fb8ec8fff164e860b83556b903576d3eb /python | |
| parent | 4f2d7c38ca2a0c35e81e0bf8e9a0e4abdf7fdfcc (diff) | |
| download | vyos-1x-3ca132fe22f732a7d4191e7e1c1d2b00d4206690.tar.gz vyos-1x-3ca132fe22f732a7d4191e7e1c1d2b00d4206690.zip | |
kea: T7913: Fixes for ping-check handling
- Kea docs state multi-threaded mode is required for ping checking.
- Parent scope needs enabling if shared-network/subnet has ping-check enabled.
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/kea.py | 2 | ||||
| -rwxr-xr-x | python/vyos/template.py | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/python/vyos/kea.py b/python/vyos/kea.py index 323fded5d..a8b38d999 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -158,7 +158,7 @@ def kea_parse_options(config): def kea_parse_subnet(subnet, config): - out = {'subnet': subnet, 'id': int(config['subnet_id']), 'user-context': {}} + out = {'subnet': subnet, 'id': int(config['subnet_id']), 'user-context': {'enable-ping-check': False}} if 'option' in config: out['option-data'] = kea_parse_options(config['option']) diff --git a/python/vyos/template.py b/python/vyos/template.py index 44278e963..128471f42 100755 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -1015,7 +1015,7 @@ def kea_shared_network_json(shared_networks): 'name': name, 'authoritative': ('authoritative' in config), 'subnet4': [], - 'user-context': {} + 'user-context': {'enable-ping-check': False} } if 'dynamic_dns_update' in config: @@ -1030,15 +1030,21 @@ 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 + subnet_ping_check = False if 'subnet' in config: for subnet, subnet_config in config['subnet'].items(): if 'disable' in subnet_config: continue + + if 'ping_check' in subnet_config: + subnet_ping_check = True + network['subnet4'].append(kea_parse_subnet(subnet, subnet_config)) + if 'ping_check' in config or subnet_ping_check: + network['user-context']['enable-ping-check'] = True + out.append(network) return dumps(out, indent=4) |
