From 604a12d65ddc5ca81bc1a8a7bbdcb7cf40a7897d Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sun, 4 Jun 2023 00:17:59 -0500 Subject: 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). --- src/conf_mode/dynamic_dns.py | 9 ++++++--- 1 file 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 -- cgit v1.2.3