aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsysconfig/network-scripts/ifup-ipv62
-rw-r--r--sysconfig/network-scripts/network-functions-ipv621
2 files changed, 23 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup-ipv6 b/sysconfig/network-scripts/ifup-ipv6
index 31b3b64c..e688422f 100755
--- a/sysconfig/network-scripts/ifup-ipv6
+++ b/sysconfig/network-scripts/ifup-ipv6
@@ -301,3 +301,5 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
fi
fi
+#wait for all global IPv6 addresses to leave the "tentative" state
+ipv6_wait_tentative $DEVICE
diff --git a/sysconfig/network-scripts/network-functions-ipv6 b/sysconfig/network-scripts/network-functions-ipv6
index 394367bb..079a055f 100644
--- a/sysconfig/network-scripts/network-functions-ipv6
+++ b/sysconfig/network-scripts/network-functions-ipv6
@@ -1042,3 +1042,24 @@ ipv6_trigger_radvd() {
return 0
}
+
+#https://www.vaspects.com/2013/12/11/services-dont-bind-to-ipv6-address/
+ipv6_wait_tentative() {
+ local fn="ipv6_wait_tentative"
+ local device=$1
+ local countdown=30
+
+ if [ -z "$device" ]; then
+ net_log $"Missing parameter 'device' (arg 1)" err $fn
+ return 1
+ fi
+
+ [ "$device" = lo ] && return 0
+
+ while [ ${countdown} -gt 0 -a -n "$(ip -6 addr show dev ${device} scope global tentative)" ]; do
+ net_log $"Waiting for interface ${device} IPv6 address(es) to leave the \"tentative\" state" info $fn
+ countdown=$(($countdown - 1))
+ sleep 1
+ done
+ return 0
+}