Deleted Added
full compact
25c25
< # $FreeBSD: head/etc/network.subr 196589 2009-08-27 15:24:26Z dougb $
---
> # $FreeBSD: head/etc/network.subr 197139 2009-09-12 22:13:41Z hrs $
47a48
> ipv6_up ${ifn} && cfg=0
49c50
< childif_create ${ifn}
---
> childif_create ${ifn} && cfg=0
54c55
< # ifn_start ifn
---
> # ifn_stop ifn
64c65
< [ -z "$ifn" ] && return 1
---
> [ -z "$ifn" ] && err 1 "ifn_stop called without an interface"
66a68
> ipv6_down ${ifn} && cfg=0
70c72
< childif_destroy ${ifn}
---
> childif_destroy ${ifn} && cfg=0
83a86
> local _cfg _ipv6_opts ifconfig_args
85a89
> # ifconfig_IF
89d92
< ifconfig $1 up
92a96,132
> # inet6 specific
> if afexists inet6; then
> if ipv6if $1; then
> if checkyesno ipv6_gateway_enable; then
> _ipv6_opts="-accept_rtadv auto_linklocal"
> else
> _ipv6_opts="auto_linklocal"
> fi
> else
> _ipv6_opts="-auto_linklocal ifdisabled"
> fi
>
> ifconfig $1 inet6 ${_ipv6_opts}
>
> # ifconfig_IF_ipv6
> ifconfig_args=`ifconfig_getargs $1 ipv6`
> if [ -n "${ifconfig_args}" ]; then
> ifconfig $1 inet6 -ifdisabled
> ifconfig $1 ${ifconfig_args}
> _cfg=0
> fi
>
> # backward compatiblity: $ipv6_ifconfig_IF
> ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF`
> if [ -n "${ifconfig_args}" ]; then
> warn "\$ipv6_ifconfig_$1 is obsolete." \
> " Use ifconfig_$1_ipv6 instead."
> ifconfig $1 inet6 -ifdisabled
> ifconfig $1 inet6 ${ifconfig_args}
> _cfg=0
> fi
> fi
>
> if [ ${_cfg} -eq 0 ]; then
> ifconfig $1 up
> fi
>
117c157
< [ -z "$1" ] && return 1
---
> local _cfg
145a186,187
> local _if _punct _var _default prefix suffix
>
163c205
< # _ifconfig_getargs if
---
> # _ifconfig_getargs if [af]
168a211
> local _ifn _af
169a213,214
> _af=${2+_$2}
>
174c219
< get_if_var $_ifn ifconfig_IF "$ifconfig_DEFAULT"
---
> get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT"
177c222
< # ifconfig_getargs if
---
> # ifconfig_getargs if [af]
182c227,228
< _tmpargs=`_ifconfig_getargs $1`
---
> local _tmpargs _arg _args
> _tmpargs=`_ifconfig_getargs $1 $2`
208a255
> local _tmpargs _arg
209a257
>
216a265
>
223a273
> local _tmpargs _arg
224a275
>
237a289
>
245a298
> local _tmpargs _arg
246a300
>
257,261c311,312
< if checkyesno synchronous_dhclient; then
< return 0
< else
< return 1
< fi
---
>
> checkyesno synchronous_dhclient
267a319
> local _tmpargs _arg
268a321
>
275a329
>
278a333,379
> # afexists af
> # Returns 0 if the address family is enabled in the kernel
> # 1 otherwise.
> afexists()
> {
> local _af
> _af=$1
>
> case ${_af} in
> inet)
> ${SYSCTL_N} net.inet > /dev/null 2>&1
> ;;
> inet6)
> ${SYSCTL_N} net.inet6 > /dev/null 2>&1
> ;;
> *)
> err 1 "afexists(): Unsupported address family: $_af"
> ;;
> esac
> }
>
> # noafif if
> # Returns 0 if the interface has no af configuration and 1 otherwise.
> noafif()
> {
> local _if
> _if=$1
>
> case $_if in
> pflog[0-9]*|\
> pfsync[0-9]*|\
> an[0-9]*|\
> ath[0-9]*|\
> ipw[0-9]*|\
> iwi[0-9]*|\
> iwn[0-9]*|\
> ral[0-9]*|\
> wi[0-9]*|\
> wl[0-9]*|\
> wpi[0-9]*)
> return 0
> ;;
> esac
>
> return 1
> }
>
284c385,388
< if ! checkyesno ipv6_enable; then
---
> local _if i
> _if=$1
>
> if ! afexists inet6; then
286a391,398
>
> # lo0 is always IPv6-enabled
> case $_if in
> lo0)
> return 0
> ;;
> esac
>
295,296c407,409
< for v6if in ${ipv6_network_interfaces}; do
< if [ "${v6if}" = "${1}" ]; then
---
>
> for i in ${ipv6_network_interfaces}; do
> if [ "$i" = "$_if" ]; then
299a413
>
302a417,456
> # ipv6_autoconfif if
> # Returns 0 if the interface should be configured for IPv6 with
> # Stateless Address Configuration, 1 otherwise.
> ipv6_autoconfif()
> {
> local _if _tmpargs _arg
> _if=$1
>
> if ! ipv6if $_if; then
> return 1
> fi
> if noafif $_if; then
> return 1
> fi
> if checkyesno ipv6_gateway_enable; then
> return 1
> fi
>
> case $_if in
> lo0|\
> stf[0-9]*|\
> faith[0-9]*|\
> lp[0-9]*|\
> sl[0-9]*)
> return 1
> ;;
> esac
>
> _tmpargs=`_ifconfig_getargs $_if ipv6`
> for _arg in $_tmpargs; do
> case $_arg in
> accept_rtadv)
> return 0
> ;;
> esac
> done
>
> return 1
> }
>
306a461
> [ -z "$1" ] && return 1
313a469
> local _if _ret
315,316c471,476
< ifalias_up ${_if}
< ipv4_addrs_common ${_if} alias
---
> _ret=1
>
> ifalias_up ${_if} inet && _ret=0
> ipv4_addrs_common ${_if} alias && _ret=0
>
> return $_ret
318a479,501
> # ipv6_up if
> # add IPv6 addresses to the interface $if
> ipv6_up()
> {
> local _if _ret
> _if=$1
> _ret=1
>
> if ! ipv6if $_if; then
> return 0
> fi
>
> ifalias_up ${_if} inet6 && _ret=0
> ipv6_prefix_hostid_addr_up ${_if} && _ret=0
> ipv6_accept_rtadv_up ${_if} && _ret=0
>
> # wait for DAD
> sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
> sleep 1
>
> return $_ret
> }
>
322a506
> local _if _ifs _ret inetList oldifs _inet
327,328d510
< ifexists ${_if} || return 1
<
346c528
< ifalias_down ${_if} && _ret=0
---
> ifalias_down ${_if} inet && _ret=0
351a534,569
> # ipv6_down if
> # remove IPv6 addresses from the interface $if
> ipv6_down()
> {
> local _if _ifs _ret inetList oldifs _inet6
> _if=$1
> _ifs="^"
> _ret=1
>
> if ! ipv6if $_if; then
> return 0
> fi
>
> ipv6_accept_rtadv_down ${_if} && _ret=0
> ifalias_down ${_if} inet6 && _ret=0
>
> inetList="`ifconfig ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`"
>
> oldifs="$IFS"
> IFS="$_ifs"
> for _inet6 in $inetList ; do
> # get rid of extraneous line
> [ -z "$_inet6" ] && break
>
> _inet6=`expr "$_inet6" : '.*\(inet6 \([0-9a-f:]*\)\).*'`
>
> IFS="$oldifs"
> ifconfig ${_if} ${_inet6} -alias
> IFS="$_ifs"
> _ret=0
> done
> IFS="$oldifs"
>
> return $_ret
> }
>
356a575,576
> local _ret _if _action _cidr _cidr_addr
> local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount
388a609
>
392c613
< # ifalias_up if
---
> # ifalias_up if af
398a620
> local _ret
399a622,643
>
> case "$2" in
> inet)
> _ret=`ifalias_ipv4_up "$1"`
> ;;
> inet6)
> _ret=`ifalias_ipv6_up "$1"`
> ;;
> esac
>
> return $_ret
> }
>
> # ifalias_ipv4_up if
> # Helper function for ifalias_up(). Handles IPv4.
> #
> ifalias_ipv4_up()
> {
> local _ret alias ifconfig_args
> _ret=1
>
> # ifconfig_IF_aliasN which starts with "inet"
403,404c647,654
< if [ -n "${ifconfig_args}" ]; then
< ifconfig $1 ${ifconfig_args} alias
---
> case "${ifconfig_args}" in
> inet\ *)
> ifconfig $1 ${ifconfig_args} alias && _ret=0
> ;;
> "")
> break
> ;;
> esac
406,407c656,677
< _ret=0
< else
---
> done
>
> return $_ret
> }
>
> # ifalias_ipv6_up if
> # Helper function for ifalias_up(). Handles IPv6.
> #
> ifalias_ipv6_up()
> {
> local _ret alias ifconfig_args
> _ret=1
>
> # ifconfig_IF_aliasN which starts with "inet6"
> alias=0
> while : ; do
> ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
> case "${ifconfig_args}" in
> inet6\ *)
> ifconfig $1 ${ifconfig_args} alias && _ret=0
> ;;
> "")
409c679,681
< fi
---
> ;;
> esac
> alias=$((${alias} + 1))
410a683,700
>
> # backward compatibility: ipv6_ifconfig_IF_aliasN.
> alias=0
> while : ; do
> ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF_alias${alias}`
> case "${ifconfig_args}" in
> "")
> break
> ;;
> *)
> ifconfig $1 inet6 ${ifconfig_args} alias && _ret=0
> warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete."
> " Use ifconfig_$1_aliasN instead."
> ;;
> esac
> alias=$((${alias} + 1))
> done
>
414c704
< #ifalias_down if
---
> #ifalias_down if af
420a711
> local _ret
421a713,734
>
> case "$2" in
> inet)
> _ret=`ifalias_ipv4_down "$1"`
> ;;
> inet6)
> _ret=`ifalias_ipv6_down "$1"`
> ;;
> esac
>
> return $_ret
> }
>
> #ifalias_ipv4_down if
> # Helper function for ifalias_down(). Handles IPv4.
> #
> ifalias_ipv4_down()
> {
> local _ret alias ifconfig_args
> _ret=1
>
> # ifconfig_IF_aliasN which starts with "inet"
425,426c738,745
< if [ -n "${ifconfig_args}" ]; then
< ifconfig $1 ${ifconfig_args} -alias
---
> case "${ifconfig_args}" in
> inet\ *)
> ifconfig $1 ${ifconfig_args} -alias && _ret=0
> ;;
> "")
> break
> ;;
> esac
428,429c747,768
< _ret=0
< else
---
> done
>
> return $_ret
> }
>
> #ifalias_ipv6_down if
> # Helper function for ifalias_down(). Handles IPv6.
> #
> ifalias_ipv6_down()
> {
> local _ret alias ifconfig_args
> _ret=1
>
> # ifconfig_IF_aliasN which starts with "inet6"
> alias=0
> while : ; do
> ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
> case "${ifconfig_args}" in
> inet6\ *)
> ifconfig $1 ${ifconfig_args} -alias && _ret=0
> ;;
> "")
431c770,772
< fi
---
> ;;
> esac
> alias=$((${alias} + 1))
432a774,791
>
> # backward compatibility: ipv6_ifconfig_IF_aliasN.
> while : ; do
> ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF_alias${alias}`
> case "${ifconfig_args}" in
> "")
> break
> ;;
> *)
> ifconfig $1 inet6 ${ifconfig_args} -alias
> alias=$((${alias} + 1))
> warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete."
> " Use ifconfig_$1_aliasN instead."
> _ret=0
> ;;
> esac
> done
>
435a795,841
> # ipv6_prefix_hostid_addr_up if
> # add IPv6 prefix + hostid addr to the interface $if
> ipv6_prefix_hostid_addr_up()
> {
> local _if prefix laddr hostid j address
> _if=$1
> prefix=`get_if_var ${_if} ipv6_prefix_IF`
>
> if [ -n "${prefix}" ]; then
> laddr=`network6_getladdr ${_if}`
> hostid=${laddr#fe80::}
> hostid=${hostid%\%*}
>
> for j in ${prefix}; do
> address=$j\:${hostid}
> ifconfig ${_if} inet6 ${address} prefixlen 64 alias
>
> # if I am a router, add subnet router
> # anycast address (RFC 2373).
> if checkyesno ipv6_gateway_enable; then
> ifconfig ${_if} inet6 $j:: prefixlen 64 \
> alias anycast
> fi
> done
> fi
> }
>
> # ipv6_accept_rtadv_up if
> # Enable accepting Router Advertisement and send Router
> # Solicitation message
> ipv6_accept_rtadv_up()
> {
> if ipv6_autoconfif $1; then
> ifconfig $1 inet6 accept_rtadv up
> rtsol ${rtsol_flags} $1
> fi
> }
>
> # ipv6_accept_rtadv_down if
> # Disable accepting Router Advertisement
> ipv6_accept_rtadv_down()
> {
> if ipv6_autoconfif $1; then
> ifconfig $1 inet6 -accept_rtadv
> fi
> }
>
445a852,853
> else
> return 1
447d854
< return 1
459a867,868
> else
> return 1
461d869
< return 1
467a876
> local _prefix _list ifn
469a879,880
>
> # create_args_IF
484a896
> local _prefix _list ifn
486a899
>
504d916
<
538a951
> cfg=1
543a957,958
>
> return ${cfg}
555a971,972
> local t
>
565a983,984
> local i peers
>
589c1008,1009
< ng_fec_create() {
---
> ng_fec_create()
> {
612a1033,1034
> local i j
>
634a1057
> local ifn
636c1059,1061
< ifconfig_args=`get_if_var $ifn ifconfig_IF_ipx`
---
>
> # ifconfig_IF_ipx
> ifconfig_args=`_ifconfig_getargs $ifn ipx`
640a1066
>
650c1076,1077
< [ -z "$1" ] && return 1
---
> local _if _ifs _ret ipxList oldifs _ipx
> _if=$1
653,657c1080
<
< ifexists $1 || return 1
<
< ipxList="`ifconfig $1 | grep 'ipx ' | tr "\n" "$_ifs"`"
<
---
> ipxList="`ifconfig ${_if} | grep 'ipx ' | tr "\n" "$_ifs"`"
658a1082
>
667c1091
< ifconfig $1 ${_ipx} delete
---
> ifconfig ${_if} ${_ipx} delete
680a1105
> local _if _ifname
682,684c1107,1108
< _ifn_list="`ifconfig -l`"
< [ -z "$_ifn_list" ] && return 0
< for _if in ${_ifn_list} ; do
---
> # ifconfig_IF_name
> for _if in `ifconfig -l`; do
689a1114
>
693d1117
< #
699a1124,1127
> # noautoconf - all interfaces, excluding IPv6 Stateless
> # Address Autoconf configured interfaces
> # autoconf - list only IPv6 Stateless Address Autoconf
> # configured interfaces
706a1135
> local type _tmplist _list _autolist _lo _if
710a1140
> _tmplist=
713d1142
< _prefix=''
721,722c1150
< _tmplist="${_tmplist}${_prefix}${_if}"
< [ -z "$_prefix" ] && _prefix=' '
---
> _tmplist="${_tmplist} ${_if}"
726c1154
< _tmplist="${_lo}${_tmplist}"
---
> _tmplist="${_lo}${_tmplist# }"
740,742c1168,1174
< if [ -z "$type" ]; then
< echo $_tmplist
< return 0
---
> _list=
> case "$type" in
> nodhcp)
> for _if in ${_tmplist} ; do
> if ! dhcpif $_if && \
> [ -n "`_ifconfig_getargs $_if`" ]; then
> _list="${_list# } ${_if}"
744,748c1176,1178
<
< # Separate out dhcp and non-dhcp interfaces
< #
< _aprefix=
< _bprefix=
---
> done
> ;;
> dhcp)
751,755c1181
< _dhcplist="${_dhcplist}${_aprefix}${_if}"
< [ -z "$_aprefix" ] && _aprefix=' '
< elif [ -n "`_ifconfig_getargs $_if`" ]; then
< _nodhcplist="${_nodhcplist}${_bprefix}${_if}"
< [ -z "$_bprefix" ] && _bprefix=' '
---
> _list="${_list# } ${_if}"
758,761d1183
<
< case "$type" in
< nodhcp)
< echo $_nodhcplist
763,764c1185,1191
< dhcp)
< echo $_dhcplist
---
> noautoconf)
> for _if in ${_tmplist} ; do
> if ! ipv6_autoconfif $_if && \
> [ -n "`_ifconfig_getargs $_if ipv6`" ]; then
> _list="${_list# } ${_if}"
> fi
> done
765a1193,1202
> autoconf)
> for _if in ${_tmplist} ; do
> if ipv6_autoconfif $_if; then
> _list="${_list# } ${_if}"
> fi
> done
> ;;
> *)
> _list=${_tmplist}
> ;;
766a1204,1206
>
> echo $_list
>
776c1216,1217
< routeget="`route -n get $1 default 2>/dev/null`"
---
> local routeget oldifs defif line
> defif=
780,781c1221
< defif=
< for line in $routeget ; do
---
> for line in `route -n get $1 default 2>/dev/null`; do
810a1251
> local val str dig
813d1253
<
816a1257
>
837,1083d1277
< # Setup the interfaces for IPv6
< network6_interface_setup()
< {
< interfaces=$*
< rtsol_interfaces=''
< case ${ipv6_gateway_enable} in
< [Yy][Ee][Ss])
< rtsol_available=no
< ;;
< *)
< rtsol_available=yes
< ;;
< esac
< for i in $interfaces; do
< rtsol_interface=yes
< prefix=`get_if_var $i ipv6_prefix_IF`
< if [ -n "${prefix}" ]; then
< rtsol_available=no
< rtsol_interface=no
< laddr=`network6_getladdr $i`
< hostid=`expr "${laddr}" : 'fe80::\(.*\)%\(.*\)'`
< for j in ${prefix}; do
< address=$j\:${hostid}
< ifconfig $i inet6 ${address} prefixlen 64 alias
<
< case ${ipv6_gateway_enable} in
< [Yy][Ee][Ss])
< # subnet-router anycast address
< # (rfc2373)
< ifconfig $i inet6 $j:: prefixlen 64 \
< alias anycast
< ;;
< esac
< done
< fi
< ipv6_ifconfig=`get_if_var $i ipv6_ifconfig_IF`
< if [ -n "${ipv6_ifconfig}" ]; then
< rtsol_available=no
< rtsol_interface=no
< ifconfig $i inet6 ${ipv6_ifconfig} alias
< fi
<
< # Wireless NIC cards are virtualized through the wlan interface
< if ! is_wired_interface ${i}; then
< case "${i}" in
< wlan*) rtsol_interface=yes ;;
< *) rtsol_interface=no ;;
< esac
< fi
<
< if [ ${rtsol_available} = yes -a ${rtsol_interface} = yes ]
< then
< case ${i} in
< lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*|pflog[0-9]*|pfsync[0-9]*)
< ;;
< *)
< rtsol_interfaces="${rtsol_interfaces} ${i}"
< ;;
< esac
< else
< ifconfig $i inet6
< fi
< done
<
< if [ ${rtsol_available} = yes -a -n "${rtsol_interfaces}" ]; then
< # Act as endhost - automatically configured.
< # You can configure only single interface, as
< # specification assumes that autoconfigured host has
< # single interface only.
< sysctl net.inet6.ip6.accept_rtadv=1
< set ${rtsol_interfaces}
< ifconfig $1 up
< rtsol ${rtsol_flags} $1
< fi
<
< for i in $interfaces; do
< alias=0
< while : ; do
< ipv6_ifconfig=`get_if_var $i ipv6_ifconfig_IF_alias${alias}`
< if [ -z "${ipv6_ifconfig}" ]; then
< break;
< fi
< ifconfig $i inet6 ${ipv6_ifconfig} alias
< alias=$((${alias} + 1))
< done
< done
< }
<
< # Setup IPv6 to IPv4 mapping
< network6_stf_setup()
< {
< case ${stf_interface_ipv4addr} in
< [Nn][Oo] | '')
< ;;
< *)
< # assign IPv6 addr and interface route for 6to4 interface
< stf_prefixlen=$((16+${stf_interface_ipv4plen:-0}))
< OIFS="$IFS"
< IFS=".$IFS"
< set ${stf_interface_ipv4addr}
< IFS="$OIFS"
< hexfrag1=`hexprint $(($1*256 + $2))`
< hexfrag2=`hexprint $(($3*256 + $4))`
< ipv4_in_hexformat="${hexfrag1}:${hexfrag2}"
< case ${stf_interface_ipv6_ifid} in
< [Aa][Uu][Tt][Oo] | '')
< for i in ${ipv6_network_interfaces}; do
< laddr=`network6_getladdr ${i}`
< case ${laddr} in
< '')
< ;;
< *)
< break
< ;;
< esac
< done
< stf_interface_ipv6_ifid=`expr "${laddr}" : \
< 'fe80::\(.*\)%\(.*\)'`
< case ${stf_interface_ipv6_ifid} in
< '')
< stf_interface_ipv6_ifid=0:0:0:1
< ;;
< esac
< ;;
< esac
< ifconfig stf0 create >/dev/null 2>&1
< ifconfig stf0 inet6 2002:${ipv4_in_hexformat}:${stf_interface_ipv6_slaid:-0}:${stf_interface_ipv6_ifid} \
< prefixlen ${stf_prefixlen}
< # disallow packets to malicious 6to4 prefix
< route add -inet6 2002:e000:: -prefixlen 20 ::1 -reject
< route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject
< route add -inet6 2002:0000:: -prefixlen 24 ::1 -reject
< route add -inet6 2002:ff00:: -prefixlen 24 ::1 -reject
< ;;
< esac
< }
<
< # Setup static routes
< network6_static_routes_setup()
< {
< # Set up any static routes.
< case ${ipv6_defaultrouter} in
< [Nn][Oo] | '')
< ;;
< *)
< ipv6_static_routes="default ${ipv6_static_routes}"
< ipv6_route_default="default ${ipv6_defaultrouter}"
< ;;
< esac
< case ${ipv6_static_routes} in
< [Nn][Oo] | '')
< ;;
< *)
< for i in ${ipv6_static_routes}; do
< ipv6_route_args=`get_if_var $i ipv6_route_IF`
< route add -inet6 ${ipv6_route_args}
< done
< ;;
< esac
< }
<
< # Setup faith
< network6_faith_setup()
< {
< case ${ipv6_faith_prefix} in
< [Nn][Oo] | '')
< ;;
< *)
< sysctl net.inet6.ip6.keepfaith=1
< ifconfig faith0 create >/dev/null 2>&1
< ifconfig faith0 up
< for prefix in ${ipv6_faith_prefix}; do
< prefixlen=`expr "${prefix}" : ".*/\(.*\)"`
< case ${prefixlen} in
< '')
< prefixlen=96
< ;;
< *)
< prefix=`expr "${prefix}" : \
< "\(.*\)/${prefixlen}"`
< ;;
< esac
< route add -inet6 ${prefix} -prefixlen ${prefixlen} ::1
< route change -inet6 ${prefix} -prefixlen ${prefixlen} \
< -ifp faith0
< done
< ;;
< esac
< }
<
< # Install the "default interface" to kernel, which will be used
< # as the default route when there's no router.
< network6_default_interface_setup()
< {
< # Choose IPv6 default interface if it is not clearly specified.
< case ${ipv6_default_interface} in
< '')
< for i in ${ipv6_network_interfaces}; do
< case $i in
< lo0|faith[0-9]*)
< continue
< ;;
< esac
< laddr=`network6_getladdr $i exclude_tentative`
< case ${laddr} in
< '')
< ;;
< *)
< ipv6_default_interface=$i
< break
< ;;
< esac
< done
< ;;
< esac
<
< # Disallow unicast packets without outgoing scope identifiers,
< # or route such packets to a "default" interface, if it is specified.
< route add -inet6 fe80:: -prefixlen 10 ::1 -reject
< case ${ipv6_default_interface} in
< [Nn][Oo] | '')
< route add -inet6 ff02:: -prefixlen 16 ::1 -reject
< ;;
< *)
< laddr=`network6_getladdr ${ipv6_default_interface}`
< route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \
< -cloning
<
< # Disable installing the default interface with the
< # case net.inet6.ip6.forwarding=0 and
< # net.inet6.ip6.accept_rtadv=0, due to avoid conflict
< # between the default router list and the manual
< # configured default route.
< case ${ipv6_gateway_enable} in
< [Yy][Ee][Ss])
< ;;
< *)
< if [ `sysctl -n net.inet6.ip6.accept_rtadv` -eq 1 ]
< then
< ndp -I ${ipv6_default_interface}
< fi
< ;;
< esac
< ;;
< esac
< }
<
1085a1280
> local proto addr rest