timesyncd: don't ask for AAAA when IPv6 is disabled

ipv6_is_supported only tells us the kernel has IPv6, not that
it's usable. ipv6_is_enabled also checks the sysctl that turns
it off, so we stop resolving addresses we can't use.
This commit is contained in:
Clayton Craft
2026-08-15 13:12:50 -07:00
parent 6279910be7
commit 8027ff6ecd
+1 -1
View File
@@ -1005,7 +1005,7 @@ int manager_connect(Manager *m) {
struct addrinfo hints = {
.ai_flags = AI_NUMERICSERV|AI_ADDRCONFIG,
.ai_socktype = SOCK_DGRAM,
.ai_family = socket_ipv6_is_supported() ? AF_UNSPEC : AF_INET,
.ai_family = socket_ipv6_is_enabled() ? AF_UNSPEC : AF_INET,
};
r = resolve_getaddrinfo(m->resolve, &m->resolve_query, m->current_server_name->string, "123", &hints, manager_resolve_handler, NULL, m);