Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178123614
D62193.1796039990.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D62193.1796039990.diff
View Options
diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr
--- a/libexec/rc/network.subr
+++ b/libexec/rc/network.subr
@@ -1789,48 +1789,38 @@
done
}
-# network6_gettentative if
-# Check if there are any tentative IPv6 addresses on $if.
-# Returns the number of tentative addresses found.
-network6_gettentative()
+# network6_hastentative
+# Returns 0 if at least one tentative address is found.
+#
+network6_hastentative()
{
- local _if proto addr rest count
- _if=$1
+ local proto addr rest
- count=0
while read proto addr rest; do
case "${proto}/${addr}/${rest}" in
inet6/*/*tentative*)
- count=$((count + 1))
+ return 0
;;
esac
done <<EOI
-`${IFCONFIG_CMD} $_if inet6 2>/dev/null`
+`${IFCONFIG_CMD} -au inet6 2>/dev/null`
EOI
- return ${count}
+ return 1
}
-# network6_gettentative if
-# Wait for "tentative" addresses to clear on $_ifnlist.
+# network6_waitdad
# Returns with timeout or when all tentative flags are gone.
+#
network6_waitdad()
{
- local _ifnlist _if count iter
- _ifnlist="$1"
+ local iter
- count=1
iter=0
# We should never need more than 2 iterations unless someone
# adds more addresses while we sleep.
- while [ ${count} -gt 0 ] && [ ${iter} -lt 2 ]; do
+ while [ ${iter} -lt 2 ] && network6_hastentative; do
sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
- count=0
- for _if in ${_ifnlist}; do
- if ! network6_gettentative ${_if} ; then
- count=1
- fi
- done
iter=$((iter + 1))
done
}
diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif
--- a/libexec/rc/rc.d/netif
+++ b/libexec/rc/rc.d/netif
@@ -198,8 +198,6 @@
esac
done
- _dadwait=
- _dadifn=
_fail=
_ok=
for ifn in ${_cooked_list# }; do
@@ -215,20 +213,15 @@
esac
if ${_func} ${ifn} $2; then
_ok="${_ok} ${ifn}"
- if ipv6if ${ifn} && [ "${ifn}" != "lo0" ] &&
- ! network6_gettentative ${ifn}; then
- _dadwait=1
- _dadifn="${_dadifn} ${ifn}"
- fi
else
_fail="${_fail} ${ifn}"
fi
done
- # inet6 address configuration needs sleep for DAD.
- case ${_func}:${_dadwait} in
- ifn_start:1)
- network6_waitdad "${_dadifn}"
+ # inet6 address configuration needs to wait for DAD.
+ case ${_func} in
+ ifn_start)
+ afexists inet6 && network6_waitdad
;;
esac
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 30, 11:59 AM (23 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42105563
Default Alt Text
D62193.1796039990.diff (2 KB)
Attached To
Mode
D62193: network.subr: Wait for DAD on child interfaces too
Attached
Detach File
Event Timeline