summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-06-04 00:17:59 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-06-04 00:21:12 -0500
commit604a12d65ddc5ca81bc1a8a7bbdcb7cf40a7897d (patch)
treec974414c74e4d9c181fe815d052c2b3827d599c6 /src/conf_mode
parentf2392055a33e537ce88c6a3124106bfd3b8b8e57 (diff)
downloadvyos-1x-604a12d65ddc5ca81bc1a8a7bbdcb7cf40a7897d.tar.gz
vyos-1x-604a12d65ddc5ca81bc1a8a7bbdcb7cf40a7897d.zip
dns: T5144: Restrict dualstack for dyndns2 protocol to dyn.com
ddclient implementation of dualstack for dyndns2 protocol is targeted for dyn.com (dyndns.org) only. Dualstack won't work for other servers supporting dyndns2 protocol (for example, dyn.dns.he.net).
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/dynamic_dns.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/conf_mode/dynamic_dns.py b/src/conf_mode/dynamic_dns.py
index 879086cc4..fe72a3180 100755
--- a/src/conf_mode/dynamic_dns.py
+++ b/src/conf_mode/dynamic_dns.py
@@ -93,9 +93,12 @@ def verify(dyndns):
if 'username' not in config:
raise ConfigError(f'"username" {error_msg}')
- if (config['protocol'] not in dualstack_supported
- and config['ip_version'] == 'both'):
- raise ConfigError(f'"{config["protocol"]}" does not support IPv4 and IPv6 at the same time')
+ if config['ip_version'] == 'both':
+ if config['protocol'] not in dualstack_supported:
+ raise ConfigError(f'"{config["protocol"]}" does not support IPv4 and IPv6 at the same time')
+ # dyndns2 protocol in ddclient honors dual stack only for dyn.com (dyndns.org)
+ if config['protocol'] == 'dyndns2' and 'server' in config and config['server'] != 'members.dyndns.org':
+ raise ConfigError(f'"{config["protocol"]}" for "{config["server"]}" does not support IPv4 and IPv6 at the same time')
return None