Skip Menu |

This queue is for tickets about the Net-NTP CPAN distribution.

Report information
The Basics
Id: 97887
Status: resolved
Priority: 0/
Queue: Net-NTP

People
Owner: Nobody in particular
Requestors: MNOONING [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.3
Fixed in: (no value)



Subject: get_ntp_response - No such host is known
I get the same result for any time server on MS Windows XP. A short code file is attached. I have strawberry Perl v5.20.0 built for MSWin32-x86-multi-thread-64int Results: Perl v5.20.0 built for MSWin32-x86-multi-thread-64int Trying time server pool.ntp.org Time server pool.ntp.org did not work IO::Socket::INET6: getaddrinfo: No such host is known. at C:/Perl/perl/site/lib/Net/NTP.pm line 148.
Subject: ntp_testing_simple.pl
# File: ntp_testing_simple.pl use 5.14.2; use Net::NTP qw(get_ntp_response); my %response; my %inner_result = (); my $ntp_time; my @time_servers = qw ( pool.ntp.org 0.pool.ntp.org 1.pool.ntp.org north-america.pool.ntp.org 0.north-america.pool.ntp.org 1.north-america.pool.ntp.org 2.north-america.pool.ntp.org 3.north-america.pool.ntp.org time-a.timefreq.bldrdoc.gov time-c.timefreq.bldrdoc.gov utcnist.colorado.edu time.nist.gov nist1-sj.WiTime.net www.pool.ntp.org ); foreach my $time_server (@time_servers) { print ("Trying time server $time_server\n"); %response = eval{ get_ntp_response($time_server, 123) }; if ($@) { print "Time server $time_server did not work\n$@\n"; } else { if ( !(defined($response{"Receive Timestamp"})) or $response{"Receive Timestamp"} eq "" ) { say ("Receive Timestamp is bad."); } else { $ntp_time = $response{"Receive Timestamp"}; # Note: "Receive Timestamp" has a value something like: # 1165590056.81202 # We need to get rid of the decimal and everything # after it. $ntp_time =~ s/\..*//; } } } __END__ Results for all time servers are the same: Trying time server pool.ntp.org Time server pool.ntp.org did not work IO::Socket::INET6: getaddrinfo: No such host is known. at C:/Perl/perl/site/lib/Net/NTP.pm line 148.
# Module: C:/Perl/perl/site/lib/Net/NTP.pm If you do not need IP6, comment out the NTP.pm lines as shown below. #....................................... if (HAVE_SOCKET_INET6) { $sock = IO::Socket::INET6->new(%args); } else { $sock = IO::Socket::INET->new(%args); } #....................................... Change the above to this: # if (HAVE_SOCKET_INET6) { # $sock = IO::Socket::INET6->new(%args); # } #else { $sock = IO::Socket::INET->new(%args); #}
Aha! Just yesterday someone posted the real reason behind the problem, INET6.pm. See ticket 97874 and follow the instructions to fix C:/Perl/perl/vendor/lib/IO/Socket/INET6.pm I made further modifcations as noted in that ticket. Hopefully this note will lead others to a quick solution. This ticket may now be closed.
See rt ticket 97874 for INET6.pm