dhclient-script: use dadfailed flag in add_ipv6_addr_with_DAD()

This commit is contained in:
Jiri Popelka 2012-01-04 18:10:42 +01:00
parent 0acc1b8c2c
commit 367b443933

View File

@ -530,22 +530,22 @@ add_ipv6_addr_with_DAD() {
for i in $(seq 5); do for i in $(seq 5); do
sleep 1 # give the DAD some time sleep 1 # give the DAD some time
# tentative flag = DAD is still not complete or failed # tentative flag == DAD is still not complete
duplicate=$(ip -6 addr show dev ${interface} tentative \ tentative=$(ip -6 addr show dev ${interface} tentative \
| grep ${new_ip6_address}/${new_ip6_prefixlen})
# dadfailed flag == address is already in use somewhere else
dadfailed=$(ip -6 addr show dev ${interface} dadfailed \
| grep ${new_ip6_address}/${new_ip6_prefixlen}) | grep ${new_ip6_address}/${new_ip6_prefixlen})
# if there's no tentative flag, address passed DAD if [ -n "${dadfailed}" ] ; then
if [ -z "${duplicate}" ]; then #ip -6 addr del ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface}
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 exit_with_hooks 3
fi fi
if [ -z "${tentative}" ] ; then
# DAD is over
return 0
fi
done
} }
dh6config() { dh6config() {