diff options
author | Roy Marples <roy@marples.name> | 2007-12-04 09:55:59 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-04 09:55:59 +0000 |
commit | 8cfb8f13338cf2ea7846a6bad15138683648cc4a (patch) | |
tree | fdb82d023fcc254320c6ac767d20864ae8c74be8 | |
parent | 6ce3bf096bb3e397371e38ee2625092d2470a5e8 (diff) |
Always show the 'Waiting for IPv6 addresses' message if we need to wait, and fixup inet6 addresses on FreeBSD-7
-rw-r--r-- | net.BSD/ifconfig.sh | 22 | ||||
-rw-r--r-- | net.Linux/iproute2.sh | 17 |
2 files changed, 26 insertions, 13 deletions
diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh index 404d1dee..4f16b586 100644 --- a/net.BSD/ifconfig.sh +++ b/net.BSD/ifconfig.sh @@ -126,7 +126,7 @@ _add_address() { ;; esac - ifconfig "${IFACE}" ${inet6} alias "$@" + ifconfig "${IFACE}" ${inet6} "$@" alias } _add_route() { @@ -160,7 +160,7 @@ _delete_addresses() { [ "$1" = "lo" -o "$1" = "lo0" ] && continue fi einfo "${addr}" - ifconfig "$1" delete "${addr}" + ifconfig "$1" "${addr}" -alias eend $? done @@ -172,7 +172,7 @@ _delete_addresses() { ::1) continue;; esac einfo "${addr}" - ifconfig "${IFACE}" inet6 delete "${addr}" + ifconfig "${IFACE}" inet6 "${addr}" -alias eend $? done eoutdent @@ -222,12 +222,18 @@ ifconfig_pre_start() { return 0 } +_ifconfig_ipv6_tentative() { + LC_ALL=C ifconfig "${IFACE}" | grep -q "^[[:space:]]*inet6 .* tentative" +} + ifconfig_post_start() { - vebegin "Waiting for IPv6 addresses" - while true; do - LC_ALL=C ifconfig "${IFACE}" | grep -q "^[[:space:]]*inet6 .* tentative" || break - done - veend 0 + if _ifconfig_ipv6_tentative; then + ebegin "Waiting for IPv6 addresses" + while true; do + _ifconfig_ipv6_tentative || break + done + eend 0 + fi } # vim: set ts=4 : diff --git a/net.Linux/iproute2.sh b/net.Linux/iproute2.sh index d11cbccb..3d4224f6 100644 --- a/net.Linux/iproute2.sh +++ b/net.Linux/iproute2.sh @@ -211,17 +211,24 @@ iproute2_pre_start() { return 0 } +_iproute2_ipv6_tentative() { + LC_ALL=C ip addr show dev "${IFACE}" | \ + grep -q "^[[:space:]]*inet6 .* tentative" +} + iproute2_post_start() { # Kernel may not have IP built in if [ -e /proc/net/route ]; then ip route flush table cache dev "${IFACE}" fi - vebegin "Waiting for IPv6 addresses" - while true; do - LC_ALL=C ip addr show dev "${IFACE}" | grep -q "^[[:space:]]*inet6 .* tentative" || break - done - veend 0 + if _iproute2_ipv6_tentative; then + ebegin "Waiting for IPv6 addresses" + while true; do + _iproute2_ipv6_tentative || break + done + eend 0 + fi } iproute2_post_stop() { |