aboutsummaryrefslogtreecommitdiff
path: root/init.d/network.in
diff options
context:
space:
mode:
Diffstat (limited to 'init.d/network.in')
-rw-r--r--init.d/network.in42
1 files changed, 42 insertions, 0 deletions
diff --git a/init.d/network.in b/init.d/network.in
index 655fc173..7c406c58 100644
--- a/init.d/network.in
+++ b/init.d/network.in
@@ -57,6 +57,40 @@ sys_interfaces()
esac
}
+tentative()
+{
+ local inet= address= rest=
+
+ case "$RC_UNAME" in
+ Linux)
+ [ -x /sbin/ip ] || return 1
+ LC_ALL=C ip addr show | while read inet address rest; do
+ case "${inet}" in
+ inet6)
+ case "${rest}" in
+ *" "tentative*) return 2;;
+ esac
+ ;;
+ esac
+ done
+ [ $? = 2 ]
+ *)
+ local inet= address= rest=
+ LC_ALL=C ifconfig -a | while read inet address rest; do
+ case "${inet}" in
+ inet6)
+ case "${rest}" in
+ *" "tentative*) return 2;;
+ esac
+ ;;
+ esac
+ done
+ [ $? = 2 ]
+ ;;
+ esac
+}
+
+
auto_interfaces()
{
local ifs= c= f=
@@ -251,6 +285,14 @@ start()
eoutdent
eend $cr
+ # Wait for any inet6 tentative addresses
+ r=5
+ while [ $r -gt 0 ]; do
+ tentative || break
+ sleep 1
+ r=$(($r - 1))
+ done
+
if [ -n "$defaultroute" ]; then
ebegin "Setting default route $defaultroute"
route add default $defaultroute