Always show the 'Waiting for IPv6 addresses' message if we need to wait, and fixup inet6 addresses on FreeBSD-7
This commit is contained in:
		@@ -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 :
 | 
			
		||||
 
 | 
			
		||||
@@ -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() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user