aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2018-01-21 13:50:38 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2018-01-21 13:50:42 -0800
commit1b52dd84770eab44b5590ecb5cd386eca36f9b34 (patch)
tree312396aef5f32fae063b72f145adbb5769edcb9c /net/iproute2.sh
parentBump for 0.6.0. (diff)
downloadnetifrc-1b52dd84770eab44b5590ecb5cd386eca36f9b34.tar.gz
netifrc-1b52dd84770eab44b5590ecb5cd386eca36f9b34.tar.bz2
netifrc-1b52dd84770eab44b5590ecb5cd386eca36f9b34.zip
net/iproute2: improve DAD tentative wait/output.
If an interface had dad_timeout=0 set, then the wait loop output is confusing. Skip it entirely, printing a useful message: > Not waiting for DAD timeout on tentative IPv6 addresses (per conf.d/net dad_timeout) Refactor the DAD tentantive conditionals for ease of debugging. Bug 636846 suggests that some kernels are still showing tentative addresses despite sysctls being set. Bug: https://bugs.gentoo.org/636846 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'net/iproute2.sh')
-rw-r--r--net/iproute2.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/net/iproute2.sh b/net/iproute2.sh
index d33ee11..2d83534 100644
--- a/net/iproute2.sh
+++ b/net/iproute2.sh
@@ -441,9 +441,13 @@ _iproute2_route_flush() {
_cmd ip $FAMILY route flush table cache dev "${IFACE}"
}
+_iproute2_ipv6_tentative_output() {
+ LC_ALL=C ip -family inet6 addr show dev ${IFACE} tentative
+}
+
_iproute2_ipv6_tentative()
{
- [ -n "$(LC_ALL=C ip -family inet6 addr show dev ${IFACE} tentative)" ] && return 0
+ [ -n "$(_iproute2_ipv6_tentative_output)" ] && return 0
return 1
}
@@ -462,11 +466,15 @@ iproute2_post_start()
# This block must be non-fatal, otherwise the interface will not be
# recorded as starting, and later services may be blocked.
- if _iproute2_ipv6_tentative; then
- if [ "$EINFO_VERBOSE" = "yes" ]; then
- veinfo "Found tentative addresses:"
- LC_ALL=C ip -family inet6 addr show dev ${IFACE} tentative
- fi
+ _iproute2_ipv6_tentative ; ret_tentative=$?
+ if [ $ret_tentative -eq 0 -a "$EINFO_VERBOSE" = "yes" ]; then
+ veinfo "Found tentative addresses:"
+ _iproute2_ipv6_tentative_output
+ fi
+ # This could be nested, but the conditionals are very deep at that point.
+ if [ $ret_tentative -eq 0 -a $_dad_timeout -le 0 ]; then
+ einfo "Not waiting for DAD timeout on tentative IPv6 addresses (per conf.d/net dad_timeout)"
+ elif [ $ret_tentative -eq 0 ]; then
einfon "Waiting for tentative IPv6 addresses to complete DAD (${_dad_timeout} seconds) "
while [ $_dad_timeout -gt 0 ]; do
_iproute2_ipv6_tentative || break