diff options
-rwxr-xr-x | ctdb/config/functions | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions index b9f3638a7d..23cb2364e3 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -869,6 +869,29 @@ add_ip_to_iface () echo "Failed to add $_ip/$_maskbits on dev $_iface" return 1 } + + # Wait 5 seconds for IPv6 addresses to stop being tentative... + if [ -z "$_bcast" ] ; then + for _x in $(seq 1 10) ; do + ip addr show to "${_ip}/128" | grep -q "tentative" || break + sleep 0.5 + done + + # If the address was a duplicate then it won't be on the + # interface so flag an error. + _t=$(ip addr show to "${_ip}/128") + case "$_t" in + "") + echo "Failed to add $_ip/$_maskbits on dev $_iface" + return 1 + ;; + *tentative*|*dadfailed*) + echo "Failed to add $_ip/$_maskbits on dev $_iface" + ip addr del "$_ip/$_maskbits" dev "$_iface" + return 1 + ;; + esac + fi } delete_ip_from_iface() |