Package: isc-dhcp-client
Version: 4.3.1-6+deb8u4
Severity: important
Tags: ipv6

Requesting an address with dhclient over dhcp6 does not always set the ipv6 
prefix length 
right. The address received seems always to get a /128 prefix set, even if the 
dhcp6 server 
sends another one.

I would expect dhclient to set the prefix lenght, if the dhcp6 server sends one.

The code in /sbin/dhclient-script under the relevant section "### DHCPv6 
Handlers" is the 
same in Devuan Jessie, where I used reportbug to write this bug, Debian Stretch 
(4.3.5-3+deb9u1)
and in Debian Sid (4.4.1-2.1+b2).

In the code that does set the ipv6 address using iproute2 there is no prefix 
mentioned at all. 
See line 385 and the following:

    385     BOUND6|RENEW6|REBIND6)
    386         if [ "${new_ip6_address}" ]; then
    387             # set leased IP
    388             ip -6 addr add ${new_ip6_address} \
    389                 dev ${interface} scope global
    390         fi

It could be that /sbin/dhclient should set the prefix to the address, I don't 
know.

This part has two problems: It should also be called upon reason REBOOT6 (see 
man dhclient-script(8)) 
and it should set the prefix if one was given (and not already present with the 
address). Something 
like the following would help:

    385     BOUND6|RENEW6|REBIND6|REBOOT6)
    386         if [ "${new_ip6_address}" ]; then
    387 
    388             # check wether a prefix was passed and add it to the address
    389             if [ -n "$new_ip6_prefixlen" ]; then
    390                 
new_ip6_address_and_prefix="${new_ip6_address}/${new_ip6_prefixlen}"
    391             else
    392                 new_ip6_address_and_prefix="${new_ip6_address}"
    393             fi
    394 
    395             # set leased IP
    396             ip -6 addr add ${new_ip6_address_and_prefix} \
    397                 dev ${interface} scope global
    398             fi

What really confuses me, is that ISC did change the IPv6 handling in the 
dhclient-script, but it is not
brought to Debian. In the upstream version they call a function 
"add_ipv6_addr_with_DAD". So I guess, the
bug is not present there. If I watch at the source package of 4.4.1-2.1, I do 
see the upstream changes, but
they are not present in the script that the binary package of 4.4.1-2.1+b2 
delivers. Sorry, I don't 
understand what's going on here.

Thank you for your help.


Regards, Adrian.


-- System Information:
Debian Release: 7.11
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-10-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

Versions of packages isc-dhcp-client depends on:
ii  debianutils       4.4+b1
ii  iproute2          3.16.0-2
ii  isc-dhcp-common   4.3.1-6+deb8u4
ii  libc6             2.19-18+deb8u10
ii  libdns-export100  1:9.9.5.dfsg-9+deb8u18
ii  libirs-export91   1:9.9.5.dfsg-9+deb8u18
ii  libisc-export95   1:9.9.5.dfsg-9+deb8u18

isc-dhcp-client recommends no packages.

Versions of packages isc-dhcp-client suggests:
pn  avahi-autoipd  <none>
pn  resolvconf     <none>

-- no debconf information

Reply via email to