aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
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:35:33 +0200
commitc1880449e4a518ca649120e5589e409d26a82550 (patch)
tree5af6e30620ccc425e67dc35cd63e173840f74930 /sysconfig
parent9c0c0098a35a8d0f4960b1a07ff38701ffce86a9 (diff)
downloadinitscripts-c1880449e4a518ca649120e5589e409d26a82550.tar
initscripts-c1880449e4a518ca649120e5589e409d26a82550.tar.gz
initscripts-c1880449e4a518ca649120e5589e409d26a82550.tar.bz2
initscripts-c1880449e4a518ca649120e5589e409d26a82550.tar.xz
initscripts-c1880449e4a518ca649120e5589e409d26a82550.zip
ipv6: wait for all global IPv6 addresses to leave the "tentative" state
Diffstat (limited to 'sysconfig')
-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 b31ad11b..8f740344 100755
--- a/sysconfig/network-scripts/ifup-ipv6
+++ b/sysconfig/network-scripts/ifup-ipv6
@@ -305,3 +305,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
+}