diff -up dhcp-4.1.1/client/scripts/linux.orig dhcp-4.1.1/client/scripts/linux --- dhcp-4.1.1/client/scripts/linux.orig 2010-04-30 15:54:43.000000000 +0200 +++ dhcp-4.1.1/client/scripts/linux 2010-04-30 15:54:43.000000000 +0200 @@ -240,8 +240,30 @@ if [ x$reason = xBOUND6 ] ; then exit_with_hooks 2; fi - ${ip} -f inet6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \ - dev ${interface} scope global + ${ip} -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \ + dev ${interface} scope global + + # repeatedly test whether newly added address passed + # duplicate address detection (DAD) + for i in $(seq 5); do + sleep 1 # give the DAD some time + + # tentative flag = DAD is still not complete or failed + duplicate=$(${ip} -6 addr show dev ${interface} tentative \ + | grep ${new_ip6_address}/${new_ip6_prefixlen}) + + # if there's no tentative flag, address passed DAD + if [ -z "${duplicate}" ]; then + break + fi + done + + # if there's still tentative flag = address didn't pass DAD = + # = it's duplicate = remove it + if [ -n "${duplicate}" ]; then + ${ip} -6 addr del ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} + exit_with_hooks 3 + fi # Check for nameserver options. make_resolv_conf