[SRU] ntp wont run on IPv6 only host unless lo has 127.0.0.1 address

Bug #715152 reported by dnmvisser on 2011-02-08
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NTP
Unknown
Unknown
ntp (Ubuntu)
Medium
Unassigned
Lucid
Medium
James Page
Maverick
Medium
James Page

Bug Description

IMPACT:
Ubuntu instances running in pure IPv6 environments (including 127.0.0.1) cannot run ntp as it dies when scanning for available interfaces.

FIX:
IPv6/IPv4 scanning has been improved in later releases; patch created from later release to resolve this issue (directly attached to this bug report).

TEST CASE:
1) On a working system with IPv4 & IPV6:
  sudo apt-get install ntp
  netstat -a | grep ntp
Ports should be mapped for both udp and udp6

2) Disable IPv4
Add the following line to /etc/network/interfaces to disable 127.0.0.1:

iface lo inet loopback
    post-up ip addr del 127.0.0.1/8 dev lo

And remove the line(s) relating to IPv4 configuration of other network interfaces (looks like iface eth* inet dhcp|static*)

3) Reboot server

4) NTP service will not be running; messages in /var/log/syslog relating to startup of daemon; however no daemon running
   ps -aef | grep ntp
   netstat -a | grep ntp

IMPACT:
Patch is relatively minimal and comes from later release.

>>>> ORIGINAL BUG REPORT <<<<<

Binary package hint: ntp

Lucid host running IPv6 only, with network configured like this:

root@svn:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:86:00:15
          inet6 addr: 2001:610:148:dead:cafe:babe:0:29/64 Scope:Global
          inet6 addr: fe80::250:56ff:fe86:15/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:3164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2075 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1516490 (1.5 MB) TX bytes:387497 (387.4 KB)

lo Link encap:Local Loopback
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Now ntpd wont start:

./../libisc/ifiter_ioctl.c:567: REQUIRE(iter->pos < (unsigned int) iter->ifc.ifc_len) failed.
Aborted

After adding an IPv4 loopback address to lo interface:

ip addr add 127.0.0.1 dev lo

ntpd is able to start.

According to http://bugs.ntp.org/show_bug.cgi?id=397 this might be related to libisc.

Related branches

James Page (james-page) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:

apport-collect 715152

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Changed in ntp (Ubuntu):
status: New → Incomplete
James Page (james-page) wrote :

Confirmed on a Lucid image; however the only way I was able to remove the 127.0.0.1 address from lo was to use the following command:

ip addr del 127.0.0.1/32 dev lo

ntp then fails to start. As stated in the original bug report, adding the address back to the interface fixes the issue.

How where you able to permanently disable the ipv4 address of the lo device?

Changed in ntp (Ubuntu):
status: Incomplete → Confirmed
status: Confirmed → Incomplete
dnmvisser (dnmvisser) wrote :

Ehm, well exactly like you did, I manually removed it, although it's done automatically from interfaces with 'pre-up'.

On Fri, 2011-02-11 at 12:04 +0000, /usr/local/dick wrote:
> Ehm, well exactly like you did, I manually removed it, although it's
> done automatically from interfaces with 'pre-up'.
>

Guessed that might be the case. I'll get this configured in my test
rig.

--
James Page
Software Engineer, Ubuntu Server Team

I've done some further investigation into this issue.

maverick exhibits the same symptoms as lucid; i.e. if the 127.0.0.1 address is not bound ntp exits on startup.

natty appears to deal with this scenario OK; removing 127.0.0.1 in a post-up step does not impact ntp.

Looks like this issue was fixed in the transition from v4.2.4 to v4.2.6 (possibly as part of 4.2.5p219)

James Page (james-page) wrote :

Output from running ntpd -n on a maverick host with no ipv4 enabled including localhost.

This code has changed maverick->natty to deal with ipv6 better (by the looks of it).

James Page (james-page) wrote :

So this issue related to upstrem bug http://bugs.ntp.org/show_bug.cgi?id=397

James Page (james-page) on 2011-04-06
Changed in ntp (Ubuntu):
status: Incomplete → Fix Released
importance: Undecided → Medium
James Page (james-page) wrote :

Minimal patch to fix running with no IPv4

description: updated
James Page (james-page) on 2011-04-11
description: updated
James Page (james-page) on 2011-04-15
summary: - ntp wont run on IPv6 only host unless lo has 127.0.0.1 address
+ [SRU] ntp wont run on IPv6 only host unless lo has 127.0.0.1 address
Changed in ntp (Ubuntu Lucid):
assignee: nobody → James Page (james-page)
Changed in ntp (Ubuntu Maverick):
assignee: nobody → James Page (james-page)
Changed in ntp (Ubuntu Lucid):
status: New → In Progress
Changed in ntp (Ubuntu Maverick):
status: New → In Progress
Changed in ntp (Ubuntu Lucid):
importance: Undecided → Medium
Changed in ntp (Ubuntu Maverick):
importance: Undecided → Medium
Clint Byrum (clint-fewbar) wrote :

In reviewing this diff for lucid-proposed:

http://launchpadlibrarian.net/69484036/ntp_1%3A4.2.4p8%2Bdfsg-1ubuntu2_1%3A4.2.4p8%2Bdfsg-1ubuntu2.1.diff.gz

and the other similar diff for maverick-proposed;

It took me a while to see why it was "Forwarded: not-needed". The Origin header of the patch would usually tell me, but that just shows me where this file was added to Natty in a merge. Its fairly difficult to tell that this patch is just the differences for this file between 4.2.4 and 4.2.6, which the linked upstream bug report tells me is the revision in which the bug has been fixed.

I don't see where our time will be used well by tracking that down much further, but I wanted to make it clear that this is not very straight forward.

Given that, we need to see wide spread testing of this before it leaves -proposed.

APPROVED: the package version 1:4.2.4p8+dfsg-1ubuntu2.1 uploaded to lucid-proposed should be accepted.
APPROVED: the package version 1:4.2.4p8+dfsg-1ubuntu6.1 uploaded to maverick-proposed should be accepted.

Accepted ntp into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ntp (Ubuntu Lucid):
status: In Progress → Fix Committed
tags: added: verification-needed
Martin Pitt (pitti) wrote :

Accepted ntp into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ntp (Ubuntu Maverick):
status: In Progress → Fix Committed
dnmvisser (dnmvisser) wrote :

Just installed "ntp 1:4.2.4p8+dfsg-1ubuntu2.1" from lucid-proposed, and that seems to do the trick.
Thanks for fixing this guys!

And well in advance of 6-6, IPv6 day ;-)

Martin Pitt (pitti) on 2011-04-20
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ntp - 1:4.2.4p8+dfsg-1ubuntu2.1

---------------
ntp (1:4.2.4p8+dfsg-1ubuntu2.1) lucid-proposed; urgency=low

  * debian/patches/fix-noipv4.patch: support running in IPv6 only
    environments (LP: #715152).
 -- James Page <email address hidden> Mon, 11 Apr 2011 11:27:28 +0100

Changed in ntp (Ubuntu Lucid):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ntp - 1:4.2.4p8+dfsg-1ubuntu6.1

---------------
ntp (1:4.2.4p8+dfsg-1ubuntu6.1) maverick-proposed; urgency=low

  * debian/patches/fix-noipv4.patch: support running in IPv6 only
    environments (LP: #715152).
 -- James Page <email address hidden> Wed, 06 Apr 2011 11:19:26 +0100

Changed in ntp (Ubuntu Maverick):
status: Fix Committed → Fix Released
tags: added: testcase
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.