Skip to content

Conversation

rhansen
Copy link
Member

@rhansen rhansen commented Aug 17, 2024

When a legacy protocol implementation returns, move its status and ip results to the new status-ipv4 and ipv4 (or status-ipv6 and ipv6) properties.

Also remove the now-unused status variable definition, and remove ip from the recap.

@KLelong Would you please try this to see if it fixes the problem?

fixes #731

@rhansen rhansen mentioned this pull request Aug 19, 2024
@rhansen rhansen force-pushed the legacy-status branch 3 times, most recently from 758f5d7 to 47d17cf Compare August 22, 2024 01:00
rhansen added 11 commits August 22, 2024 02:08
This doesn't add any new command-line arguments, but it does mean that
a new command-line argument can be added for any variable, not just
those in `$variables{'global-defaults'}`, and its value will be copied
to `%globals`.

My main motivation for this commit is to make it possible to remove
the redundant variable declarations between
`$variables{'global-defaults'}` and
`$variables{'protocol-common-defaults'}`.
The code already treats `undef` and 0 the same, and `undef` omits them
from the recap which simplifies testing.
This is mostly to simplify tests, but it also improves readability.

The infrastructure changes in this commit also make it possible to
introduce a new `url` variable that defaults to `opt('server', $h)`
concatenated with `opt('script', $h)` so that we can start migrating
away from those user-unfriendly variables.
Now that the default changes depending on `usev4` and `usev6`, this is
no longer necessary.  Removing it simplifies the code a bit and makes
the behavior of unit tests match the overall behavior a bit better.
  * Delete values from `$config{$h}` and `$recap{$h}` when resetting
    values (as opposed to setting a falsy value).
  * Delete values from `$config{$h}` and `$recap{$h}` when they are no
    longer needed.

This is mostly done to improve the tests in `t/update_nics.pl`.
Rather than check whether `use`, `usev4`, or `usev6` is a non-disabled
value, check that `wantip`, `wantipv4`, or `wantipv6` is a defined
value.  This is preparation for removing the `status` variable in a
future commit.
When a legacy protocol implementation returns, move its `status` and
`ip` results to the new `status-ipv4` and `ipv4` (or `status-ipv6` and
`ipv6`) properties.

Also remove the now-unused `status` variable definition, and remove
`ip` from the recap.
@rhansen rhansen merged commit 3dafdbf into ddclient:master Aug 22, 2024
10 checks passed
@rhansen rhansen deleted the legacy-status branch August 22, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cache does not work
1 participant