summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-11-04 16:01:02 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-11-30 21:42:23 -0600
commite058ee4909728541f3cd63110908c86214bf76c0 (patch)
tree42890f3fc1a03d4f8379a11f8ecb1335f041a3db /src/conf_mode
parent535b4c1de059627072ee831437371c9cefd26eba (diff)
downloadvyos-1x-e058ee4909728541f3cd63110908c86214bf76c0.tar.gz
vyos-1x-e058ee4909728541f3cd63110908c86214bf76c0.zip
ddclient: T5708: Validate proper use of `web-options`
`web-options` is only applicable when using HTTP(S) web request to obtain the IP address. Apply guard for that.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/dns_dynamic.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py
index 874c4b689..d71dc22fd 100755
--- a/src/conf_mode/dns_dynamic.py
+++ b/src/conf_mode/dns_dynamic.py
@@ -82,6 +82,10 @@ def verify(dyndns):
f'based Dynamic DNS service on "{address}"')
# Dynamic DNS service provider - configuration validation
+ if 'web_options' in dyndns['address'][address] and address != 'web':
+ raise ConfigError(f'"web-options" is applicable only when using HTTP(S) web request to obtain the IP address')
+
+ # Dynamic DNS service provider - configuration validation
if 'service' in dyndns['address'][address]:
for service, config in dyndns['address'][address]['service'].items():
error_msg = f'is required for Dynamic DNS service "{service}" on "{address}"'