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

IPv6 literal source fails to initialize properly #1770

Open
Mynacol opened this issue Dec 13, 2024 · 0 comments
Open

IPv6 literal source fails to initialize properly #1770

Mynacol opened this issue Dec 13, 2024 · 0 comments

Comments

@Mynacol
Copy link

Mynacol commented Dec 13, 2024

(This is all on version 1.3.1 and as far I see, the changes to 1.4.0 don't improve this problem)

I use ntpd-rs for months, on most machines with server sources specified as domain names. But on one server, I prefer to use hard-coded IP addresses. On this setup I'm only able to use IPv4 addresses and not IPv6 addresses. The error is always spamming the logs with the following:

WARN ntpd::daemon::spawn::standard: error while resolving source address, retrying error=Custom { kind: Uncategorized, error: "failed to lookup address information: Name or service not known" }

I tried the following two types of configuration, both lead to the same error (One with port number, one without. IP addresses replaced with the same format):

[observability]
log-level = "warn"
observation-path = "/var/run/ntpd-rs/observe"
observation-permissions = 384

[[source]]
address = "[2001:db8:abc:123::1]:123"
mode = "server"

[[source]]
address = "192.0.2.1"
mode = "server"

[synchronization]
minimum-agreeing-sources = 3
[observability]
log-level = "warn"
observation-path = "/var/run/ntpd-rs/observe"
observation-permissions = 384

[[source]]
address = "2001:db8:abc:123::1"
mode = "server"

[[source]]
address = "192.0.2.1"
mode = "server"

[synchronization]
minimum-agreeing-sources = 3

You seem to be mis-parsing the IPv6 literals as domain names and trying to resolve them with DNS, which obviously fails.

P.S.:
I was looking through the source code and found this line. It is not fully correct, as there are IPv6 addresses with only two :. I know of a public DNS server at 2a09:: that would fail the config. You sould probably change it to >= 2.
https://github.com/pendulum-project/ntpd-rs/blob/v1.4.0/ntpd/src/daemon/config/ntp_source.rs#L261

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

1 participant