Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider ipv64.net: it's not possible to use the default check-server set for [email protected] to get an update of the A record. #497

Open
hrzlgnm opened this issue Sep 24, 2024 · 4 comments

Comments

@hrzlgnm
Copy link
Contributor

hrzlgnm commented Sep 24, 2024

The code in that the retrieves the ip

DO(http_init(client, "Checking for IP# change", strstr(provider->system->name, "ipv6") ? TCP_FORCE_IPV6 : TCP_FORCE_IPV4));
to be used via the default set ifconfig.me defined in
.checkip_name = "ifconfig.me",
is confused and assumes ipv6 is enforced, due to the name ipv64.net containing ipv6.

This leads to an issue, that a definition like the following one:

provider [email protected] { 
    username = <REDACTED>
    password = none
    hostname = <REDACTED>
}

tries to update the ipv4 record using the retrieved ipv6 address.

I'm currently using the following workaround:

provider [email protected] { 
    ...
    checkip-command = "/usr/bin/curl -s -4 https://ifconfig.me/ip"
}

There are more constructs like the mentioned above.

if (strstr(info->system->name, "ipv6"))

CHECK(http_init(&client, "Json query",strstr(info->system->name, "ipv6") ? TCP_FORCE_IPV6 : TCP_FORCE_IPV4));

CHECK(http_init(&client, "Json query",strstr(info->system->name, "ipv6") ? TCP_FORCE_IPV6 : TCP_FORCE_IPV4));

rc = http_init(&client, "Fetching account API key",strstr(info->system->name, "ipv6") ? TCP_FORCE_IPV6 : TCP_FORCE_IPV4);

rc = http_init(&client, "Sending record list query",strstr(info->system->name, "ipv6") ? TCP_FORCE_IPV6 : TCP_FORCE_IPV4);

if (strstr(info->system->name, "ipv6"))

return snprintf(ctx->request_buf, ctx->request_buflen,

rc = http_init(client, "Sending IP# update to DDNS server", strstr(info->system->name, "ipv6") ? TCP_FORCE_IPV6 : TCP_FORCE_IPV4);

Edit: make links to code permalinks

@hrzlgnm
Copy link
Contributor Author

hrzlgnm commented Sep 24, 2024

As proposed in #496

@hrzlgnm hrzlgnm changed the title Provider: it's not possible to use the default check-server set for [email protected] to get an update of the A record. Provider ipv64.net: it's not possible to use the default check-server set for [email protected] to get an update of the A record. Sep 24, 2024
@hrzlgnm
Copy link
Contributor Author

hrzlgnm commented Sep 24, 2024

I'm also happy to tackle this, if i get some hints how to approach this properly.

@troglobit
Copy link
Owner

Unfortunately I have no time to guide anyone at the moment, but I'll do my best to review PRs (provided they are small and logical change sets).

@hrzlgnm
Copy link
Contributor Author

hrzlgnm commented Sep 25, 2024

Fair enough, I'll give it a shot with checking that the provider name starts with "ipv6" instead of containing it.

hrzlgnm added a commit to hrzlgnm/inadyn that referenced this issue Sep 25, 2024
Also factor out the duplicated check to own function while at it
Closes troglobit#497
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

No branches or pull requests

2 participants