Control: severity -1 serious

Moin

This bug breaks any DHCPv6 use, as it never resets the lifetime of
existing addresses on rebind.  This makes it not really useful for IPv6,
depending on settings of outside control.  Let's set the severity
correctly as broken or mostly so.

Not completely minimal and not yet properly tested patch:

diff --git a/debian/dhclient-script.linux b/debian/dhclient-script.linux
index f9b734a..e0133b7 100644
--- a/debian/dhclient-script.linux
+++ b/debian/dhclient-script.linux
@@ -393,10 +393,11 @@ case "$reason" in
         ;;
 
     BOUND6|RENEW6|REBIND6)
-        if [ "${new_ip6_address}" ]; then
+        if [ "${new_ip6_address}" ] && [ "${new_ip6_prefixlen}" ]; then
             # set leased IP
-            ip -6 addr add ${new_ip6_address} \
-                dev ${interface} scope global
+            ip -6 addr replace ${new_ip6_address}/${new_ip6_prefixlen} \
+                dev ${interface} scope global valid_lft ${new_max_life} \
+                preferred_lft ${new_preferred_life}
         fi
 
         # update /etc/resolv.conf
@@ -409,19 +410,23 @@ case "$reason" in
         ;;
 
     DEPREF6)
+        if [ -z "${cur_ip6_prefixlen}" ]; then
+            exit_with_hooks 2
+        fi
+
         # set preferred lifetime of leased IP to 0
-        ip -6 addr change ${cur_ip6_address} \
+        ip -6 addr change ${cur_ip6_address}/${cur_ip6_prefixlen} \
             dev ${interface} scope global preferred_lft 0
 
         ;;
 
     EXPIRE6|RELEASE6|STOP6)
-        if [ -z "${old_ip6_address}" ]; then
+        if [ -z "${old_ip6_address}" ] || [ -z "${old_ip6_prefixlen}" ]; then
             exit_with_hooks 2
         fi
 
         # delete leased IP
-        ip -6 addr del ${old_ip6_address} \
+        ip -6 addr del ${old_ip6_address}/${old_ip6_prefixlen} \
             dev ${interface}
 
         ;;

I intend to fix that from oldstable up.

Regards,
Bastian

-- 
Vulcans do not approve of violence.
                -- Spock, "Journey to Babel", stardate 3842.4

Reply via email to