Bug 333525

Summary: xntp ntpd does not work with ipv6 servers
Product: [openSUSE] openSUSE 10.3 Reporter: Thomas Schäfer <tschaefer>
Component: NetworkAssignee: Andreas Schneider <anschneider>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: tschaefer, varkoly
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 10.3   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Thomas Schäfer 2007-10-12 17:50:13 UTC
ntpd works only with ipv4 Server 
with ipv6-Servers it does not synchronize (stratum 16)
Comment 1 Thomas Schäfer 2007-11-15 13:14:29 UTC
The bug was reported for hardware x86-64

It is also valid for x86 (32bit)
Comment 2 Michael Skibbe 2007-11-15 13:27:32 UTC
which version do you and the server use? (rpm -q xntp)

attach /var/log/messages /var/log/ntp from client.

is the server listen on ipv6 and ipv4 or only on ipv6. (netstat)

do you have an ipv6 adress? (ifconfong)

please provide more information if you open a bug next time.
Comment 3 Thomas Schäfer 2007-11-15 21:09:33 UTC
rpm -q xntp
xntp-4.2.4p3-25

/var/log/messages
Nov 15 21:56:06 printserver ntpdate[13032]: adjust time server 2001:4ca0:0:102:0:123:1:1 offset 0.000044 sec
Nov 15 21:56:06 printserver ntpd[13038]: ntpd 4.2.4p3@1.1502-o Fri Sep 21 21:36:25 UTC 2007 (1)
Nov 15 21:56:06 printserver ntpd[13039]: precision = 1.000 usec
Nov 15 21:56:06 printserver ntpd[13039]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Nov 15 21:56:06 printserver ntpd[13039]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Nov 15 21:56:06 printserver ntpd[13039]: Listening on interface #1 wildcard, ::#123 Disabled
Nov 15 21:56:06 printserver ntpd[13039]: Listening on interface #2 lo, ::1#123 Enabled
Nov 15 21:56:06 printserver ntpd[13039]: Listening on interface #3 eth0, 2001:4ca0:4f01:0:21c:c4ff:fe19:9a60#123 Enabled
Nov 15 21:56:06 printserver ntpd[13039]: Listening on interface #4 eth0, fe80::21c:c4ff:fe19:9a60#123 Enabled
Nov 15 21:56:06 printserver ntpd[13039]: Listening on interface #5 lo, 127.0.0.1#123 Enabled
Nov 15 21:56:06 printserver ntpd[13039]: Listening on interface #6 eth0, 129.187.148.99#123 Enabled
Nov 15 21:56:06 printserver ntpd[13039]: kernel time sync status 0040
Nov 15 21:56:06 printserver ntpd[13039]: frequency initialized -58.381 PPM from /var/lib/ntp/drift/ntp.drift

var/log/ntp
15 Nov 21:56:07 ntpd[13039]: Deleting interface #2 lo, ::1#123, interface stats: received=0, sent=0, dropped=0, active_time=1 secs
15 Nov 21:56:07 ntpd[13039]: Deleting interface #3 eth0, 2001:4ca0:4f01:0:21c:c4ff:fe19:9a60#123, interface stats: received=0, sent=0, dropped=0, active_time=1 secs
15 Nov 21:56:07 ntpd[13039]: Deleting interface #4 eth0, fe80::21c:c4ff:fe19:9a60#123, interface stats: received=0, sent=0, dropped=0, active_time=1 secs

netstat -anp | grep ntp
udp        0      0 129.187.148.99:123      0.0.0.0:*                           13039/ntpd
udp        0      0 127.0.0.1:123           0.0.0.0:*                           13039/ntpd
udp        0      0 0.0.0.0:123             0.0.0.0:*                           13039/ntpd
udp        0      0 :::123                  :::*                                13039/ntpd
unix  2      [ ]         DGRAM                    37837  13039/ntpd

ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:4ca0:4f01:0:21c:c4ff:fe19:9a60/64 scope global dynamic
       valid_lft 2591980sec preferred_lft 604780sec
    inet6 fe80::21c:c4ff:fe19:9a60/64 scope link
       valid_lft forever preferred_lft forever

ip6tables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

printserver:/etc # ping6 -c 2 ntp6.space.net
PING ntp6.space.net(ns6.DNS.Space.Net) 56 data bytes
64 bytes from ns6.DNS.Space.Net: icmp_seq=1 ttl=54 time=16.2 ms
64 bytes from ns6.DNS.Space.Net: icmp_seq=2 ttl=54 time=16.1 ms

--- ntp6.space.net ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 16.184/16.220/16.257/0.132 ms
printserver:/etc # ping6 -c 2 ntp.ipv6.uni-leipzig.de
PING ntp.ipv6.uni-leipzig.de(ns.ipv6.uni-leipzig.de) 56 data bytes
64 bytes from ns.ipv6.uni-leipzig.de: icmp_seq=1 ttl=57 time=9.60 ms
64 bytes from ns.ipv6.uni-leipzig.de: icmp_seq=2 ttl=57 time=9.65 ms

--- ntp.ipv6.uni-leipzig.de ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 9.604/9.630/9.656/0.026 ms
printserver:/etc # ping6 -c 2 ntp1.ipv6.lrz-muenchen.de
PING ntp1.ipv6.lrz-muenchen.de(ntp1.ipv6.lrz-muenchen.de) 56 data bytes
64 bytes from ntp1.ipv6.lrz-muenchen.de: icmp_seq=1 ttl=62 time=0.518 ms
64 bytes from ntp1.ipv6.lrz-muenchen.de: icmp_seq=2 ttl=62 time=0.514 ms

--- ntp1.ipv6.lrz-muenchen.de ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.514/0.516/0.518/0.002 ms
printserver:/etc # ping6 -c 2 ntp.rhrk.uni-kl.de
PING ntp.rhrk.uni-kl.de(minnehaha.rhrk.uni-kl.de) 56 data bytes
64 bytes from minnehaha.rhrk.uni-kl.de: icmp_seq=1 ttl=54 time=13.9 ms
64 bytes from minnehaha.rhrk.uni-kl.de: icmp_seq=2 ttl=54 time=14.1 ms

--- ntp.rhrk.uni-kl.de ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 13.912/14.021/14.131/0.161 ms
printserver:/etc #

printserver:/etc # ntpdc -c peers
     remote           local      st poll reach  delay   offset    disp
=======================================================================
=ntp1.ipv6.lrz-m ::              16   64    0 0.00000  0.000000 3.99217
=tunnel49.ipv6.x ::              16   64    0 0.00000  0.000000 3.99217
=minnehaha.rhrk. ::              16   64    0 0.00000  0.000000 3.99217
=ns.ipv6.uni-lei ::              16   64    0 0.00000  0.000000 3.99217
=ns6.DNS.Space.N ::              16   64    0 0.00000  0.000000 3.99217
*ntp1.lrz-muench 129.187.148.99   1   64  377 0.00124 -0.000048 0.05391


-------------------------------------
compared with suse 10.2: 
rpm -q xntp
xntp-4.2.2p4-6

 ntpdc -c peers
     remote           local      st poll reach  delay   offset    disp
=======================================================================
*ntp1.ipv6.lrz-m 2001:6f8:120c:0  1  256  377 0.08661  0.015250 0.08246
=tunnel49.ipv6.x 2001:6f8:120c:0  1  256  377 0.15598 -0.006663 0.08955
=minnehaha.rhrk. 2001:6f8:120c:0  2  256  377 0.08490  0.017395 0.10594
=ns.ipv6.uni-lei 2001:6f8:120c:0  3  256  377 0.08649  0.037264 0.10600
=ns6.DNS.Space.N 2001:6f8:120c:0  2  256  377 0.08568  0.016943 0.10406


Comment 4 Thomas Schäfer 2007-11-23 19:01:56 UTC
The problem is related to chroot-jail

The problem is a known bug.
http://support.ntp.org/bin/view/Support/KnownOsIssues#Section_9.2.3.2.5.1.

There a some workarounds provided.

If you change the default behavior you may close this ticket.

Comment 7 Michael Skibbe 2008-01-23 13:51:02 UTC
*** Bug 355608 has been marked as a duplicate of this bug. ***
Comment 8 Michael Skibbe 2008-02-18 11:55:00 UTC
assign to new maintainer
Comment 9 Andreas Schneider 2008-03-25 10:31:34 UTC
The problem should be the apparmor profile bug #361548. Could you please stop apparmor and test.
Comment 10 Andreas Schneider 2008-03-25 11:20:43 UTC

*** This bug has been marked as a duplicate of bug 361548 ***
Comment 11 Thomas Schäfer 2008-03-25 15:38:46 UTC
This Bug is not a problem of apparmor!


It as a problem with chroot-jail.

Therefore it is not a dublicate of bug 361548.



There are some workarounds provided:
------------------------------------------------------------------------------
9.2.4.2.5.1. A problem with IPv6 interfaces after chroot

The ifiter_ioctl interface iterator reads IPv6 interface names from /proc/net/if_inet6. If no proc filesystem is mounted in the chroot jail, ntpd drops all IPv6 interfaces after startup.

The easy choices are

    * don't use chroot
    * mount proc in the chroot directory
    * disable interface updates with -U 0. ntpd will not notice any new or dropped interfaces anymore. 

It might also work to

    * change ifiter_ioctl to enumerate IPv6 interface by another method. IPv4 interfaces are enumerated through ioctl on a socket.
    * install libinet6 to enable getifaddrs() 

-------------------------------------------------------------------------------

opensuse should apply one of them, the easiest way is to disable chroot-jail in defaults.

Regards,
Thomas Schäfer

Comment 12 Andreas Schneider 2008-03-25 16:08:29 UTC
Mounting /proc would be an option. We have to evaluate this.
Comment 13 Andreas Schneider 2008-03-25 16:48:59 UTC
This will be fixed with openSUSE 11.0. You can grab it after the next factory rollout.