Stateless DHCPv6 not working in precise

Bug #1214385 reported by Philipp Kern on 2013-08-20
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
isc-dhcp (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned

Bug Description

[Impact]
isc-dhcp-client in precise does not do stateless DHCPv6 correctly if it's enabled as "dhcp 1" within "iface <IFACE> inet6 auto" within /etc/network/interfaces. The dhclient-script responsible for updating /etc/resolv.conf exists if it doesn't find an IPv6 address in its environment, which is only true for stateful DHCPv6.

[Test Case]
* You should have IPv6 on your network segment, make a note of the subnet.
* Have a stateless DHCPv6 server listen on the network segment:
** Minimal dhcpd6.conf:
authoritative;
option dhcp6.name-servers 2001:4860:4860::8888, 2001:4860:4860::8844;
option dhcp6.domain-search "ubuntu.com";
pid-file-name "/tmp/dhcpd.test.pid";
subnet6 fd7a:4ac2:1751:0::/64 {}
** Adjust the subnet information to the one you're actually using or the DHCP server will refuse to start.
** Install isc-dhcp-server on a host on the same network segment.
** Disable apparmor (it will yield losts of EPERM for the test file locations).
** Start up the server there using: /usr/sbin/dhcpd -cf dhcpd.conf -6 -lf /tmp/leases.test
* Have network configuration be managed by ifupdown, not network-manager:
* Add the following configuration to /etc/network/interfaces:
iface eth0 inet6 auto
 dhcp 1
* ifdown eth0 && ifup eth0 (alternatively: dhclient -6 -S -v IFACE)
* Check if /etc/resolv.conf contains:
search ubuntu.com.
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
* If the old version of the package is installed, /etc/resolv.conf content will not change.

[Regression Potential]
The suggested change is already present since quantal. The change itself is self-contained

[Additional Info]
/sbin/dhclient-script in precise's isc-dhcp-client 4.1.ESV-R4-0ubuntu5.8 contains the following snippet:

    BOUND6|RENEW6|REBIND6)
        if [ -z "${new_ip6_address}" ] || [ -z "${new_ip6_prefixlen}" ]; then
            exit_with_hooks 2
        fi

        # set leased IP
        ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
            dev ${interface} scope global

This assumes that the result of the DHCPv6 transaction is an address with a prefix, which is the case for stateful DHCPv6. For stateless DHCPv6, however, we only get additional information that's not directly address-related. This is fixed since quantal and reads like this:

    BOUND6|RENEW6|REBIND6)
        if [ "${new_ip6_address}" ] && [ "${new_ip6_prefixlen}" ]; then
            # set leased IP
            ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
                dev ${interface} scope global
        fi

It looks like the only change from the diff to the current saucy version we need for it to work correctly.

Philipp Kern (pkern) wrote :
Philipp Kern (pkern) on 2013-08-20
Changed in isc-dhcp (Ubuntu):
status: New → Fix Released
Philipp Kern (pkern) on 2013-08-20
description: updated
Philipp Kern (pkern) on 2013-08-21
description: updated
description: updated
Scott Kitterman (kitterman) wrote :

Seems reasonable. I'll accept it for SRU if someone would upload it.

Hello Philipp, or anyone else affected,

Accepted into raring-proposed. The package will build now and be available in a few hours in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Changed in isc-dhcp (Ubuntu Precise):
status: New → Fix Committed
Philipp Kern (pkern) wrote :

root@ale:~# apt-cache policy isc-dhcp-client
isc-dhcp-client:
  Installed: 4.1.ESV-R4-0ubuntu5.8
  Candidate: 4.1.ESV-R4-0ubuntu5.8
  Version table:
     4.1.ESV-R4-0ubuntu5.9 0
        400 http://ubuntu-precise.mirror.corp.google.com/ubuntu/ precise-proposed/main amd64 Packages
 *** 4.1.ESV-R4-0ubuntu5.8 0
        600 https://rapture-prod.corp.google.com/ ubuntu-precise-base/main amd64 Packages
        100 /var/lib/dpkg/status
root@ale:~# tail -n 5 /etc/network/interfaces
auto eth0
iface eth0 inet manual
iface eth0 inet6 auto
 dhcp 1

root@ale:~# ifdown eth0; ifup eth0
ifdown: interface eth0 not configured
net.ipv6.conf.eth0.accept_ra = 1
net.ipv6.conf.eth0.autoconf = 1
root@ale:~# grep nameserver /etc/resolv.conf
nameserver 172.16.xxx.xxx
root@ale:~# apt-get install isc-dhcp-client=4.1.ESV-R4-0ubuntu5.9 isc-dhcp-common=4.1.ESV-R4-0ubuntu5.9
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  resolvconf avahi-autoipd
The following packages will be upgraded:
  isc-dhcp-client isc-dhcp-common
2 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/637 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 225378 files and directories currently installed.)
Preparing to replace isc-dhcp-client 4.1.ESV-R4-0ubuntu5.8 (using .../isc-dhcp-client_4.1.ESV-R4-0ubuntu5.9_amd64.deb) ...
Unpacking replacement isc-dhcp-client ...
Preparing to replace isc-dhcp-common 4.1.ESV-R4-0ubuntu5.8 (using .../isc-dhcp-common_4.1.ESV-R4-0ubuntu5.9_amd64.deb) ...
Unpacking replacement isc-dhcp-common ...
Processing triggers for man-db ...
Setting up isc-dhcp-common (4.1.ESV-R4-0ubuntu5.9) ...
Setting up isc-dhcp-client (4.1.ESV-R4-0ubuntu5.9) ...
root@ale:~# ifdown eth0; ifup eth0
Sleeping for 338 seconds ...
net.ipv6.conf.eth0.accept_ra = 1
net.ipv6.conf.eth0.autoconf = 1
root@ale:~# grep nameserver /etc/resolv.conf
nameserver 2401:xxxx:xxxx::53

(IP addresses edited out.) Works for me.

Philipp Kern (pkern) wrote :

Could this be moved to -updates now?

Normally we don't release updates on Friday to make sure someone is around to deal with regression. Is it urgent?

Philipp Kern (pkern) wrote :

No, next week is fine. ;-)

Philipp Kern (pkern) wrote :

Friendly ping. :)

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package isc-dhcp - 4.1.ESV-R4-0ubuntu5.9

---------------
isc-dhcp (4.1.ESV-R4-0ubuntu5.9) precise-proposed; urgency=low

  * debian/dhclient-script.linux: Allow stateless DHCPv6 to complete
    configuration. (LP: #1214385)
 -- Philipp Kern <email address hidden> Tue, 20 Aug 2013 15:24:27 +0200

Changed in isc-dhcp (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers