From 0892655fd69b9790a669b2c1b46b6f9d9b7dda73 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 18 Jul 2024 04:45:34 -0400 Subject: [PATCH 1/9] dyndns2: Add response handling TODO comments --- ddclient.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ddclient.in b/ddclient.in index c13e355..dd9c60c 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4111,6 +4111,21 @@ sub nic_dyndns2_update { next if !header_ok($hosts, $reply); my @reply = split /\n/, $reply; my $state = 'header'; + # From : + # + # If updating multiple hostnames, hostname-specific return codes are given one per line, + # in the same order as the hostnames were specified. Return codes indicating a failure + # with the account or the system are given only once. + # + # TODO: There is no mention of what happens if multiple IP addresses are supplied (e.g., + # IPv4 and IPv6) for a host. If one address fails to update and the other doesn't, is that + # one error status line? An error status line and a success status line? Or is an update + # considered to be all-or-nothing and the status applies to the operation as a whole? If + # the IPv4 address changes but not the IPv6 address does that result in a status of "good" + # because the set of addresses for a host changed even if a subset did not? + # + # TODO: The logic below applies the last line's status to all hosts. Change it to apply + # each status to its corresponding host. for my $line (@reply) { if ($state eq 'header') { $state = 'body'; @@ -4147,6 +4162,10 @@ sub nic_dyndns2_update { failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); } } elsif ($status =~ /w(\d+)(.)/) { + # TODO: does not mention + # anything about wait statuses. Is this obsolete (this code has been here + # since at least 2006)? Or does a different DynDNS-like service emit wait + # lines? my ($wait, $units) = ($1, lc $2); my ($sec, $scale) = ($wait, 1); ($scale, $units) = (1, 'seconds') if $units eq 's'; From db3472a7ce01253a2418cb87045be8a93da9e9e8 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 13 Jul 2024 04:01:22 -0400 Subject: [PATCH 2/9] dyndns2: Simplify response parsing --- ddclient.in | 91 ++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/ddclient.in b/ddclient.in index dd9c60c..23d8002 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4109,8 +4109,14 @@ sub nic_dyndns2_update { next; } next if !header_ok($hosts, $reply); - my @reply = split /\n/, $reply; - my $state = 'header'; + # Some services can return 200 OK even if there is an error (e.g., bad authentication, + # updates too frequent) so the body of the response must also be checked. + (my $body = $reply) =~ s/^.*?\n\n//s; + my @reply = split(qr/\n/, $body); + if (!@reply) { + failed("updating %s: Could not connect to %s.", $hosts, $groupcfg{'server'}); + next; + } # From : # # If updating multiple hostnames, hostname-specific return codes are given one per line, @@ -4127,62 +4133,53 @@ sub nic_dyndns2_update { # TODO: The logic below applies the last line's status to all hosts. Change it to apply # each status to its corresponding host. for my $line (@reply) { - if ($state eq 'header') { - $state = 'body'; - } elsif ($state eq 'body') { - $state = 'results' if $line eq ''; - } elsif ($state =~ /^results/) { - $state = 'results2'; - # bug #10: some dyndns providers does not return the IP so - # we can't use the returned IP - my ($status, $returnedips) = split / /, lc $line; + # bug #10: some dyndns providers does not return the IP so + # we can't use the returned IP + my ($status, $returnedips) = split / /, lc $line; + for my $h (@hosts) { + $config{$h}{'status-ipv4'} = $status if $ipv4; + $config{$h}{'status-ipv6'} = $status if $ipv6; + } + if ($status eq 'good') { for my $h (@hosts) { - $config{$h}{'status-ipv4'} = $status if $ipv4; - $config{$h}{'status-ipv6'} = $status if $ipv6; + $config{$h}{'ipv4'} = $ipv4 if $ipv4; + $config{$h}{'ipv6'} = $ipv6 if $ipv6; + $config{$h}{'mtime'} = $now; } - if ($status eq 'good') { + success("updating %s: %s: IPv4 address set to %s", $hosts, $status, $ipv4) if $ipv4; + success("updating %s: %s: IPv6 address set to %s", $hosts, $status, $ipv6) if $ipv6; + } elsif (exists $errors{$status}) { + if ($status eq 'nochg') { + warning("updating %s: %s: %s", $hosts, $status, $errors{$status}); for my $h (@hosts) { $config{$h}{'ipv4'} = $ipv4 if $ipv4; $config{$h}{'ipv6'} = $ipv6 if $ipv6; $config{$h}{'mtime'} = $now; + $config{$h}{'status-ipv4'} = 'good' if $ipv4; + $config{$h}{'status-ipv6'} = 'good' if $ipv6; } - success("updating %s: %s: IPv4 address set to %s", $hosts, $status, $ipv4) if $ipv4; - success("updating %s: %s: IPv6 address set to %s", $hosts, $status, $ipv6) if $ipv6; - } elsif (exists $errors{$status}) { - if ($status eq 'nochg') { - warning("updating %s: %s: %s", $hosts, $status, $errors{$status}); - for my $h (@hosts) { - $config{$h}{'ipv4'} = $ipv4 if $ipv4; - $config{$h}{'ipv6'} = $ipv6 if $ipv6; - $config{$h}{'mtime'} = $now; - $config{$h}{'status-ipv4'} = 'good' if $ipv4; - $config{$h}{'status-ipv6'} = 'good' if $ipv6; - } - } else { - failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); - } - } elsif ($status =~ /w(\d+)(.)/) { - # TODO: does not mention - # anything about wait statuses. Is this obsolete (this code has been here - # since at least 2006)? Or does a different DynDNS-like service emit wait - # lines? - my ($wait, $units) = ($1, lc $2); - my ($sec, $scale) = ($wait, 1); - ($scale, $units) = (1, 'seconds') if $units eq 's'; - ($scale, $units) = (60, 'minutes') if $units eq 'm'; - ($scale, $units) = (60*60, 'hours') if $units eq 'h'; - $sec = $wait * $scale; - for my $h (@hosts) { - $config{$h}{'wtime'} = $now + $sec; - } - warning("updating %s: %s: wait %s %s before further updates", $hosts, $status, $wait, $units); } else { - failed("updating %s: unexpected status (%s)", $hosts, $line); + failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); } + } elsif ($status =~ /w(\d+)(.)/) { + # TODO: does not mention + # anything about wait statuses. Is this obsolete (this code has been here + # since at least 2006)? Or does a different DynDNS-like service emit wait + # lines? + my ($wait, $units) = ($1, lc $2); + my ($sec, $scale) = ($wait, 1); + ($scale, $units) = (1, 'seconds') if $units eq 's'; + ($scale, $units) = (60, 'minutes') if $units eq 'm'; + ($scale, $units) = (60*60, 'hours') if $units eq 'h'; + $sec = $wait * $scale; + for my $h (@hosts) { + $config{$h}{'wtime'} = $now + $sec; + } + warning("updating %s: %s: wait %s %s before further updates", $hosts, $status, $wait, $units); + } else { + failed("updating %s: unexpected status (%s)", $hosts, $line); } } - failed("updating %s: Could not connect to %s.", $hosts, $groupcfg{'server'}) - if $state ne 'results2'; } } From 8a667e3f57ac5fef7f64eae8e416afcb05e14d8d Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 13 Jul 2024 04:23:27 -0400 Subject: [PATCH 3/9] dyndns2: Treat `nochg` as `good` to eliminate duplicate code --- ddclient.in | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ddclient.in b/ddclient.in index 23d8002..d602229 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4136,6 +4136,10 @@ sub nic_dyndns2_update { # bug #10: some dyndns providers does not return the IP so # we can't use the returned IP my ($status, $returnedips) = split / /, lc $line; + if ($status eq 'nochg') { + warning("updating %s: %s: %s", $hosts, $status, $errors{$status}); + $status = 'good'; + } for my $h (@hosts) { $config{$h}{'status-ipv4'} = $status if $ipv4; $config{$h}{'status-ipv6'} = $status if $ipv6; @@ -4149,18 +4153,7 @@ sub nic_dyndns2_update { success("updating %s: %s: IPv4 address set to %s", $hosts, $status, $ipv4) if $ipv4; success("updating %s: %s: IPv6 address set to %s", $hosts, $status, $ipv6) if $ipv6; } elsif (exists $errors{$status}) { - if ($status eq 'nochg') { - warning("updating %s: %s: %s", $hosts, $status, $errors{$status}); - for my $h (@hosts) { - $config{$h}{'ipv4'} = $ipv4 if $ipv4; - $config{$h}{'ipv6'} = $ipv6 if $ipv6; - $config{$h}{'mtime'} = $now; - $config{$h}{'status-ipv4'} = 'good' if $ipv4; - $config{$h}{'status-ipv6'} = 'good' if $ipv6; - } - } else { - failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); - } + failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); } elsif ($status =~ /w(\d+)(.)/) { # TODO: does not mention # anything about wait statuses. Is this obsolete (this code has been here From 88f140d470f2ee661ae4c25f5caab150ea6c49ee Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 18 Jul 2024 05:03:18 -0400 Subject: [PATCH 4/9] dyndns2: Invert condition to improve readability --- ddclient.in | 54 +++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/ddclient.in b/ddclient.in index d602229..4f4bcbe 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4144,34 +4144,36 @@ sub nic_dyndns2_update { $config{$h}{'status-ipv4'} = $status if $ipv4; $config{$h}{'status-ipv6'} = $status if $ipv6; } - if ($status eq 'good') { - for my $h (@hosts) { - $config{$h}{'ipv4'} = $ipv4 if $ipv4; - $config{$h}{'ipv6'} = $ipv6 if $ipv6; - $config{$h}{'mtime'} = $now; + if ($status ne 'good') { + if (exists($errors{$status})) { + failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); + } elsif ($status =~ qr/w(\d+)(.)/) { + # TODO: does not mention + # anything about wait statuses. Is this obsolete (this code has been here + # since at least 2006)? Or does a different DynDNS-like service emit wait + # lines? + my ($wait, $units) = ($1, lc $2); + my ($sec, $scale) = ($wait, 1); + ($scale, $units) = (1, 'seconds') if $units eq 's'; + ($scale, $units) = (60, 'minutes') if $units eq 'm'; + ($scale, $units) = (60*60, 'hours') if $units eq 'h'; + $sec = $wait * $scale; + for my $h (@hosts) { + $config{$h}{'wtime'} = $now + $sec; + } + warning("updating %s: %s: wait %s %s before further updates", $hosts, $status, $wait, $units); + } else { + failed("updating %s: unexpected status (%s)", $hosts, $line); } - success("updating %s: %s: IPv4 address set to %s", $hosts, $status, $ipv4) if $ipv4; - success("updating %s: %s: IPv6 address set to %s", $hosts, $status, $ipv6) if $ipv6; - } elsif (exists $errors{$status}) { - failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); - } elsif ($status =~ /w(\d+)(.)/) { - # TODO: does not mention - # anything about wait statuses. Is this obsolete (this code has been here - # since at least 2006)? Or does a different DynDNS-like service emit wait - # lines? - my ($wait, $units) = ($1, lc $2); - my ($sec, $scale) = ($wait, 1); - ($scale, $units) = (1, 'seconds') if $units eq 's'; - ($scale, $units) = (60, 'minutes') if $units eq 'm'; - ($scale, $units) = (60*60, 'hours') if $units eq 'h'; - $sec = $wait * $scale; - for my $h (@hosts) { - $config{$h}{'wtime'} = $now + $sec; - } - warning("updating %s: %s: wait %s %s before further updates", $hosts, $status, $wait, $units); - } else { - failed("updating %s: unexpected status (%s)", $hosts, $line); + next; } + for my $h (@hosts) { + $config{$h}{'ipv4'} = $ipv4 if $ipv4; + $config{$h}{'ipv6'} = $ipv6 if $ipv6; + $config{$h}{'mtime'} = $now; + } + success("updating %s: %s: IPv4 address set to %s", $hosts, $status, $ipv4) if $ipv4; + success("updating %s: %s: IPv6 address set to %s", $hosts, $status, $ipv6) if $ipv6; } } } From 90de2f9606b4a353d090a6824700c61ebcd84403 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 13 Jul 2024 04:33:44 -0400 Subject: [PATCH 5/9] dyndns2: Improve readability of status parsing --- ddclient.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ddclient.in b/ddclient.in index 4f4bcbe..bca675a 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4133,9 +4133,12 @@ sub nic_dyndns2_update { # TODO: The logic below applies the last line's status to all hosts. Change it to apply # each status to its corresponding host. for my $line (@reply) { - # bug #10: some dyndns providers does not return the IP so - # we can't use the returned IP - my ($status, $returnedips) = split / /, lc $line; + # The IP address normally comes after the status, but we ignore it. We could compare + # it with the expected address and mark the update as failed if it differs, but (1) + # some services do not return the IP; and (2) comparison is brittle (e.g., + # 192.000.002.001 vs. 192.0.2.1) and false errors could cause high load on the service + # (an update attempt every min-error-interval instead of every max-interval). + (my $status = $line) =~ s/ .*$//; if ($status eq 'nochg') { warning("updating %s: %s: %s", $hosts, $status, $errors{$status}); $status = 'good'; From 1e73f4a51a92e17b9a43bd5f3ad35f0dd94bb840 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 13 Jul 2024 04:52:05 -0400 Subject: [PATCH 6/9] dyndns2: Wrap long list of group by attributes --- ddclient.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ddclient.in b/ddclient.in index bca675a..508a3f7 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4050,7 +4050,6 @@ EoEXAMPLE ###################################################################### sub nic_dyndns2_update { debug("\nnic_dyndns2_update -------------------"); - my @groups = group_hosts_by(\@_, qw(login password server script static custom wildcard mx backupmx wantipv4 wantipv6)); my %errors = ( 'badauth' => 'Bad authorization (username or password)', 'badsys' => 'The system parameter given was not valid', @@ -4064,7 +4063,20 @@ sub nic_dyndns2_update { 'dnserr' => 'System error: DNS error encountered. Contact support@dyndns.org', 'nochg' => 'No update required; unnecessary attempts to change to the current address are considered abusive', ); - for my $group (@groups) { + my @group_by_attrs = qw( + backupmx + custom + login + mx + password + script + server + static + wantipv4 + wantipv6 + wildcard + ); + for my $group (group_hosts_by(\@_, @group_by_attrs)) { my @hosts = @{$group->{hosts}}; my %groupcfg = %{$group->{cfg}}; my $hosts = join(',', @hosts); From adfd68d5e0e868329ef4aef8ed12f8a944457964 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 18 Jul 2024 05:19:58 -0400 Subject: [PATCH 7/9] dyndns2: Refine log messages --- ddclient.in | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ddclient.in b/ddclient.in index 508a3f7..e5292f5 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4084,12 +4084,11 @@ sub nic_dyndns2_update { my $ipv6 = $groupcfg{'wantipv6'}; delete $config{$_}{'wantipv4'} for @hosts; delete $config{$_}{'wantipv6'} for @hosts; - info("setting IPv4 address to %s for %s", $ipv4, $hosts) if $ipv4; - info("setting IPv6 address to %s for %s", $ipv6, $hosts) if $ipv6; - verbose("UPDATE:", "updating %s", $hosts); + info("$hosts: setting IPv4 address to $ipv4") if $ipv4; + info("$hosts: setting IPv6 address to $ipv6") if $ipv6; my $url = "$groupcfg{'server'}$groupcfg{'script'}?system="; if ($groupcfg{'custom'}) { - warning("updating %s: 'custom' and 'static' may not be used together. ('static' ignored)", $hosts) + warning("$hosts: 'custom' and 'static' may not be used together ('static' ignored)") if $groupcfg{'static'}; $url .= 'custom'; } elsif ($groupcfg{'static'}) { @@ -4117,7 +4116,7 @@ sub nic_dyndns2_update { password => $groupcfg{'password'}, ) // ''; if ($reply eq '') { - failed("updating %s: Could not connect to %s.", $hosts, $groupcfg{'server'}); + failed("$hosts: Could not connect to $groupcfg{'server'}"); next; } next if !header_ok($hosts, $reply); @@ -4126,7 +4125,7 @@ sub nic_dyndns2_update { (my $body = $reply) =~ s/^.*?\n\n//s; my @reply = split(qr/\n/, $body); if (!@reply) { - failed("updating %s: Could not connect to %s.", $hosts, $groupcfg{'server'}); + failed("$hosts: Could not connect to $groupcfg{'server'}"); next; } # From : @@ -4152,7 +4151,7 @@ sub nic_dyndns2_update { # (an update attempt every min-error-interval instead of every max-interval). (my $status = $line) =~ s/ .*$//; if ($status eq 'nochg') { - warning("updating %s: %s: %s", $hosts, $status, $errors{$status}); + warning("$hosts: $status: $errors{$status}"); $status = 'good'; } for my $h (@hosts) { @@ -4161,7 +4160,7 @@ sub nic_dyndns2_update { } if ($status ne 'good') { if (exists($errors{$status})) { - failed("updating %s: %s: %s", $hosts, $status, $errors{$status}); + failed("$hosts: $status: $errors{$status}"); } elsif ($status =~ qr/w(\d+)(.)/) { # TODO: does not mention # anything about wait statuses. Is this obsolete (this code has been here @@ -4176,9 +4175,9 @@ sub nic_dyndns2_update { for my $h (@hosts) { $config{$h}{'wtime'} = $now + $sec; } - warning("updating %s: %s: wait %s %s before further updates", $hosts, $status, $wait, $units); + warning("$hosts: wait $wait $units before further updates"); } else { - failed("updating %s: unexpected status (%s)", $hosts, $line); + failed("$hosts: unexpected status: $line"); } next; } @@ -4187,8 +4186,8 @@ sub nic_dyndns2_update { $config{$h}{'ipv6'} = $ipv6 if $ipv6; $config{$h}{'mtime'} = $now; } - success("updating %s: %s: IPv4 address set to %s", $hosts, $status, $ipv4) if $ipv4; - success("updating %s: %s: IPv6 address set to %s", $hosts, $status, $ipv6) if $ipv6; + success("$hosts: IPv4 address set to $ipv4") if $ipv4; + success("$hosts: IPv6 address set to $ipv6") if $ipv6; } } } From 26f57bf36aa46f5863610322be9183bd2b83d03a Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 18 Jul 2024 05:25:05 -0400 Subject: [PATCH 8/9] dyndns2: Delete obsolete(?) "wait" response handling --- ChangeLog.md | 4 ++++ ddclient.in | 15 --------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 19633f3..b531974 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -34,6 +34,10 @@ repository history](https://github.com/ddclient/ddclient/commits/master). * Deprecated built-in web IP discovery services are not listed in the output of `--list-web-services`. [#682](https://github.com/ddclient/ddclient/pull/682) + * `dyndns2`: Support for "wait" response lines has been removed. The Dyn + documentation does not mention such responses, and the code to handle them, + untouched since at least 2006, is believed to be obsolete. + [#709](https://github.com/ddclient/ddclient/pull/709) ### New features diff --git a/ddclient.in b/ddclient.in index e5292f5..d60f87d 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4161,21 +4161,6 @@ sub nic_dyndns2_update { if ($status ne 'good') { if (exists($errors{$status})) { failed("$hosts: $status: $errors{$status}"); - } elsif ($status =~ qr/w(\d+)(.)/) { - # TODO: does not mention - # anything about wait statuses. Is this obsolete (this code has been here - # since at least 2006)? Or does a different DynDNS-like service emit wait - # lines? - my ($wait, $units) = ($1, lc $2); - my ($sec, $scale) = ($wait, 1); - ($scale, $units) = (1, 'seconds') if $units eq 's'; - ($scale, $units) = (60, 'minutes') if $units eq 'm'; - ($scale, $units) = (60*60, 'hours') if $units eq 'h'; - $sec = $wait * $scale; - for my $h (@hosts) { - $config{$h}{'wtime'} = $now + $sec; - } - warning("$hosts: wait $wait $units before further updates"); } else { failed("$hosts: unexpected status: $line"); } From 30a7c5ad78e9697526e74f28eea0885b33e93782 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 19 Jul 2024 01:47:27 -0400 Subject: [PATCH 9/9] dyndns2: Delete obsolete `custom` and `static` options says: > We will accept these parameters without generating error messages: > > * `system`, previously used to identify update type --- ChangeLog.md | 3 +++ ddclient.conf.in | 20 -------------------- ddclient.in | 20 ++------------------ 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index b531974..f703f3a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -38,6 +38,9 @@ repository history](https://github.com/ddclient/ddclient/commits/master). documentation does not mention such responses, and the code to handle them, untouched since at least 2006, is believed to be obsolete. [#709](https://github.com/ddclient/ddclient/pull/709) + * `dyndns2`: The obsolete `static` and `custom` options have been removed. + Setting the options may produce a warning. + [#709](https://github.com/ddclient/ddclient/pull/709) ### New features diff --git a/ddclient.conf.in b/ddclient.conf.in index 8a336ac..1c7ae35 100644 --- a/ddclient.conf.in +++ b/ddclient.conf.in @@ -81,26 +81,6 @@ pid=@runstatedir@/ddclient.pid # record PID in file. # protocol=dyndns2 \ # your-dynamic-host.dyndns.org -## -## dyndns.org static addresses -## -## (supports variables: wildcard,mx,backupmx) -## -# static=yes, \ -# server=members.dyndns.org, \ -# protocol=dyndns2 \ -# your-static-host.dyndns.org - -## -## dyndns.org custom addresses -## -## (supports variables: wildcard,mx,backupmx) -## -# custom=yes, \ -# server=members.dyndns.org, \ -# protocol=dyndns2 \ -# your-domain.top-level,your-other-domain.top-level - ## ## ZoneEdit (zoneedit.com) ## diff --git a/ddclient.in b/ddclient.in index d60f87d..332f086 100755 --- a/ddclient.in +++ b/ddclient.in @@ -709,7 +709,6 @@ our %variables = ( 'dyndns-common-defaults' => { 'backupmx' => setv(T_BOOL, 0, 1, 0, undef), 'mx' => setv(T_OFQDN, 0, 1, undef, undef), - 'static' => setv(T_BOOL, 0, 1, 0, undef), 'wildcard' => setv(T_BOOL, 0, 1, 0, undef), }, ); @@ -848,6 +847,7 @@ our %protocols = ( 'variables' => { %{$variables{'protocol-common-defaults'}}, %{$variables{'dyndns-common-defaults'}}, + 'static' => setv(T_BOOL, 0, 1, 0, undef), }, }, 'dyndns2' => { @@ -857,7 +857,6 @@ our %protocols = ( 'variables' => { %{$variables{'protocol-common-defaults'}}, %{$variables{'dyndns-common-defaults'}}, - 'custom' => setv(T_BOOL, 0, 1, 0, undef), 'script' => setv(T_STRING, 0, 1, '/nic/update', undef), }, }, @@ -4015,8 +4014,6 @@ Configuration variables applicable to the 'dyndns2' protocol are: server=fqdn.of.service ## defaults to members.dyndns.org script=/path/to/script ## defaults to /nic/update backupmx=no|yes ## indicates that this host is the primary MX for the domain. - static=no|yes ## indicates that this host has a static IP address. - custom=no|yes ## indicates that this host is a 'custom' top-level domain name. mx=any.host.domain ## a host MX'ing for this host definition. wildcard=no|yes ## add a DNS wildcard CNAME record that points to login=service-login ## login name and password registered with the service @@ -4065,13 +4062,11 @@ sub nic_dyndns2_update { ); my @group_by_attrs = qw( backupmx - custom login mx password script server - static wantipv4 wantipv6 wildcard @@ -4086,18 +4081,7 @@ sub nic_dyndns2_update { delete $config{$_}{'wantipv6'} for @hosts; info("$hosts: setting IPv4 address to $ipv4") if $ipv4; info("$hosts: setting IPv6 address to $ipv6") if $ipv6; - my $url = "$groupcfg{'server'}$groupcfg{'script'}?system="; - if ($groupcfg{'custom'}) { - warning("$hosts: 'custom' and 'static' may not be used together ('static' ignored)") - if $groupcfg{'static'}; - $url .= 'custom'; - } elsif ($groupcfg{'static'}) { - $url .= 'statdns'; - } else { - $url .= 'dyndns'; - } - $url .= "&hostname=$hosts"; - $url .= "&myip="; + my $url = "$groupcfg{'server'}$groupcfg{'script'}?hostname=$hosts&myip="; $url .= $ipv4 if $ipv4; if ($ipv6) { $url .= "," if $ipv4;