[pkg-dhcp-devel] Bug#632888: isc-dhcp: stateless DHCPv6 does not work

Colin Watson cjwatson at ubuntu.com
Wed Jul 6 19:21:46 UTC 2011


Package: isc-dhcp
Version: 4.1.1-P1-17
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

I tried setting up a test system to use stateless DHCPv6 (RFC3736, in
which addresses are obtained using SLAAC or similar but DHCPv6 is used
for additional configuration such as DNS servers).  In this mode,
/etc/resolv.conf is not currently set up correctly, because
dhclient-script incorrectly considers BOUND6/RENEW6/REBIND6 replies
without an IP address to be an error.  The following patch corrects
this.

  * Handle DHCPv6 BOUND6/RENEW6/REBIND6 replies that don't include an IP
    address, for stateless DHCPv6.

diff --git a/debian/dhclient-script.linux b/debian/dhclient-script.linux
index 624a17e..adaf640 100644
--- a/debian/dhclient-script.linux
+++ b/debian/dhclient-script.linux
@@ -318,14 +318,12 @@ case "$reason" in
         ;;
 
     BOUND6|RENEW6|REBIND6)
-        if [ -z "${new_ip6_address}" ] || [ -z "${new_ip6_prefixlen}" ]; then
-            exit_with_hooks 2
+        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
 
-        # set leased IP
-        ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
-            dev ${interface} scope global
-
         # update /etc/resolv.conf
         if [ "${reason}" = BOUND6 ] ||
            [ "${new_dhcp6_name_servers}" != "${old_dhcp6_name_servers}" ] ||

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the pkg-dhcp-devel mailing list