From f563932981eeec8625ac0f21ac21ee67db91887f Mon Sep 17 00:00:00 2001 From: rintyuu Date: Mon, 18 Nov 2024 16:59:36 -0800 Subject: [PATCH] force use ipv4 instead of ipv6 in some network configs, ipv6 isnt configured properly, but ipv4 is. forced usage of ipv4 instead of ipv6 --- ntpdetails.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntpdetails.cpp b/ntpdetails.cpp index 549fa60..d791821 100644 --- a/ntpdetails.cpp +++ b/ntpdetails.cpp @@ -12,7 +12,8 @@ void queryNTPServer(const std::string& server) { asio::io_context io_context; asio::ip::udp::resolver resolver(io_context); - asio::ip::udp::endpoint endpoint = *resolver.resolve(server, std::to_string(NTP_PORT)).begin(); + asio::ip::udp::resolver::query query(asio::ip::udp::v4(), server, std::to_string(NTP_PORT)); + asio::ip::udp::endpoint endpoint = *resolver.resolve(query).begin(); asio::ip::udp::socket socket(io_context); socket.open(asio::ip::udp::v4());