aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2016-06-13 16:35:23 +0200
committerLukas Nykryn <lnykryn@redhat.com>2016-06-13 16:43:13 +0200
commit8121b7f765e33e7d84eecd762e1c0d37964bfcaf (patch)
tree57bc4ff424a5e5bed7436e57841dcc01dbd43e5d
parenta4eefc6bdfb1e6872ef83428b833a0cc6474e8e2 (diff)
downloadinitscripts-8121b7f765e33e7d84eecd762e1c0d37964bfcaf.tar
initscripts-8121b7f765e33e7d84eecd762e1c0d37964bfcaf.tar.gz
initscripts-8121b7f765e33e7d84eecd762e1c0d37964bfcaf.tar.bz2
initscripts-8121b7f765e33e7d84eecd762e1c0d37964bfcaf.tar.xz
initscripts-8121b7f765e33e7d84eecd762e1c0d37964bfcaf.zip
ipv6: wait for all global IPv6 addresses to leave the "tentative" state
Cherry-picked from: c188044 Resolves: #1245951
-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
+}