FreeBSD Bugzilla – Attachment 130333 Details for
Bug 174225
[network.subr] [patch] add support for ipv6_addrs_IF style aliases to rc.conf(5)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
network.subr_ipv6_addrs_IF.patch.txt
network.subr_ipv6_addrs_IF.patch (text/plain), 2.14 KB, created by
Kimmo Paasiala
on 2012-12-26 09:50:01 UTC
(
hide
)
Description:
network.subr_ipv6_addrs_IF.patch.txt
Filename:
MIME Type:
Creator:
Kimmo Paasiala
Created:
2012-12-26 09:50:01 UTC
Size:
2.14 KB
patch
obsolete
>Index: etc/network.subr >=================================================================== >--- etc/network.subr (revision 244687) >+++ etc/network.subr (working copy) >@@ -438,6 +438,13 @@ > ;; > esac > >+ # Test for $ipv6_addrs_IF. If it exists then the >+ # interface should be configured for IPv6 >+ _tmpargs=$(get_if_var $_if ipv6_addrs_IF) >+ if [ -n "${_tmpargs}" ]; then >+ return 0 >+ fi >+ > case "${ipv6_network_interfaces}" in > $_if|"$_if "*|*" $_if"|*" $_if "*|[Aa][Uu][Tt][Oo]) > # True if $ifconfig_IF_ipv6 is defined. >@@ -562,6 +569,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 > >@@ -619,6 +627,7 @@ > > ipv6_accept_rtadv_down ${_if} && _ret=0 > ipv6_prefix_hostid_addr_common ${_if} -alias && _ret=0 >+ ipv6_addrs_common ${_if} -alias && _ret=0 > ifalias_down ${_if} inet6 && _ret=0 > > inetList="`ifconfig ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`" >@@ -684,6 +693,49 @@ > return $_ret > } > >+ >+ipv6_addrs_common() >+{ >+ local _ret _if _action _ip6prefix _ip6prefixes >+ local _ip6addr _prefixlen >+ local _range _ip6net _ip6low _ip6high >+ _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##*/} >+ _range=${_ip6addr##*:} >+ _ip6net=${_ip6addr%:*} >+ _ip6low=${_range%-*} >+ _ip6high=${_range#*-} >+ >+# If deleting an alias, set _prefixlen to null string. >+ if [ "${_action}" = "-alias" ]; then >+ _prefixlen="" >+ else >+ _prefixlen="prefixlen $_prefixlen" >+ fi >+ >+ _ip6high=$(("0x${_ip6high}")) >+ _ip6count=$(("0x${_ip6low}")) >+ while [ "${_ip6count}" -le "${_ip6high}" ]; do >+ # Re-uses the _ip6addr variable from above >+ _ip6addr=$(printf "%x" "${_ip6count}") >+ eval "ifconfig ${_if} inet6 ${_ip6net}:${_ip6addr} ${_prefixlen} ${_action}" >+ _ip6count=$((${_ip6count}+1)) >+ _ret=0 >+ done >+ done >+ >+ return $_ret >+} >+ >+ >+ > # ifalias_up if af > # Configure aliases for network interface $if. > # It returns 0 if at least one alias was configured or
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 174225
:
130331
|
130332
| 130333