--- network.subr 2012-12-04 16:36:54.777519679 +0200 +++ network.subr 2012-12-04 16:37:15.578523530 +0200 @@ -562,6 +562,7 @@ fi ifalias_up ${_if} inet6 && _ret=0 + ipv6_addrs_common ${_if} alias && _ret=0 ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0 ipv6_accept_rtadv_up ${_if} && _ret=0 @@ -684,6 +685,31 @@ return $_ret } + +ipv6_addrs_common() +{ + local _ret _if _action _ip6prefix _ip6prefixes + local _ip6addr _prefixlen + _ret=1 + _if=$1 + _action=$2 + +# get the prefixes from ipv6_addrs_IF variable + _ip6prefixes=`get_if_var $_if ipv6_addrs_IF` + for _ip6prefix in ${_ip6prefixes}; do + _ip6addr=${_ip6prefix%%/*} + _prefixlen=${_ip6prefix##*/} + if [ "${_action}" = "-alias" ]; then + _prefixlen="" + else + _prefixlen="prefixlen $_prefixlen" + fi + eval "ifconfig ${_if} inet6 ${_action} ${_ip6addr} ${_prefixlen}" + done +} + + + # ifalias_up if af # Configure aliases for network interface $if. # It returns 0 if at least one alias was configured or