Subject: bin/28954: ntpq does not fall back to IPv4
To: None <,>
From: Kimmo Suominen <>
List: netbsd-bugs
Date: 01/13/2005 16:39:07
>Number:         28954
>Category:       bin
>Synopsis:       ntpq does not fall back to IPv4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 13 16:39:06 +0000 2005
>Originator:     Kimmo Suominen
>Release:        NetBSD 2.99.11 2004-12-15
Kimmo Suominen
System: NetBSD 2.99.11 NetBSD 2.99.11 (GW-GENERIC) #85: Sat Jan 1 11:30:14 EST 2005 i386
Architecture: i386
Machine: i386
When connecting to a host with both IPv6 and IPv4 addresses, ntpq
will not try IPv4 if the IPv6 connection fails.
I'm running xnptd v3 on some machines.  It only listens on IPv4.

Connections to localhost fail with "Connection refused".

    beowulf:~> ntpq -p
    ntpq: read: Connection refused
    beowulf:~> ntpq -p
	 remote           refid  [... truncated ...]
    beowulf:~> grep localhost /etc/hosts
    ::1                                     localhost                               localhost

Connections to fail with "No route to host" (as
beowulf does not have a global IPv6 address or IPv6 routes).

    beowulf:~> ntpq -p
    ntpq: connect: No route to host
    Exit 1
    beowulf:~> host has address has IPv6 address 2001:240:584:1::1 mail is handled by 0 mail is handled by 50
    beowulf:~> ntpq -p
	 remote           refid  [... truncated ...]

Normally applications should try IPv4 if IPv6 fails:

    beowulf:~> telnet
    Trying 2001:240:584:1::1...
    telnet: connect to address 2001:240:584:1::1: No route to host
    Connected to