diff --git a/dhclient-script b/dhclient-script index e5a6830..fbf1032 100644 --- a/dhclient-script +++ b/dhclient-script @@ -563,20 +563,20 @@ add_ipv6_addr_with_DAD() { for i in $(seq 5); do sleep 1 # give the DAD some time + addr=$(ip -6 addr show dev ${interface} \ + | grep ${new_ip6_address}/${new_ip6_prefixlen}) + # tentative flag == DAD is still not complete - tentative=$(ip -6 addr show dev ${interface} tentative \ - | grep ${new_ip6_address}/${new_ip6_prefixlen}) + tentative=$(echo "${addr}" | grep tentative) # dadfailed flag == address is already in use somewhere else - dadfailed=$(ip -6 addr show dev ${interface} dadfailed \ - | grep ${new_ip6_address}/${new_ip6_prefixlen}) + dadfailed=$(echo "${addr}" | grep dadfailed) if [ -n "${dadfailed}" ] ; then - #ip -6 addr del ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} + # address was added with valid_lft/preferred_lft 'forever', remove it + ip -6 addr del ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} exit_with_hooks 3 fi if [ -z "${tentative}" ] ; then - addr=$(ip -6 addr show dev ${interface} \ - | grep ${new_ip6_address}/${new_ip6_prefixlen}) if [ -n "${addr}" ]; then # DAD is over return 0 @@ -586,6 +586,7 @@ add_ipv6_addr_with_DAD() { fi fi done + return 0 } dh6config() { diff --git a/dhcp.spec b/dhcp.spec index f6be761..9b42fcb 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -18,7 +18,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.3.1 -Release: 5%{?dist} +Release: 6%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -588,6 +588,9 @@ done %doc doc/html/ %changelog +* Tue Aug 26 2014 Jiri Popelka - 12:4.3.1-6 +- dhclient-script: another improvement of add_ipv6_addr_with_DAD() + * Mon Aug 25 2014 Jiri Popelka - 12:4.3.1-5 - spec: use -D with 'install' - dhclient-script: IPv6 address which fails DAD is auto-removed when it was