network.subr (212575) | network.subr (212577) |
---|---|
1# 2# Copyright (c) 2003 The FreeBSD Project. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions 6# are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23# SUCH DAMAGE. 24# | 1# 2# Copyright (c) 2003 The FreeBSD Project. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions 6# are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23# SUCH DAMAGE. 24# |
25# $FreeBSD: head/etc/network.subr 212575 2010-09-13 19:52:04Z hrs $ | 25# $FreeBSD: head/etc/network.subr 212577 2010-09-13 19:53:22Z hrs $ |
26# 27 28# 29# Subroutines commonly used from network startup scripts. 30# Requires that rc.conf be loaded first. 31# 32 33# ifn_start ifn --- 69 unchanged lines hidden (view full) --- 103 if checkyesno ipv6_prefer; then 104 _ipv6_opts="-ifdisabled" 105 else 106 _ipv6_opts="ifdisabled" 107 fi 108 109 # backward compatibility: $ipv6_enable 110 case $ipv6_enable in | 26# 27 28# 29# Subroutines commonly used from network startup scripts. 30# Requires that rc.conf be loaded first. 31# 32 33# ifn_start ifn --- 69 unchanged lines hidden (view full) --- 103 if checkyesno ipv6_prefer; then 104 _ipv6_opts="-ifdisabled" 105 else 106 _ipv6_opts="ifdisabled" 107 fi 108 109 # backward compatibility: $ipv6_enable 110 case $ipv6_enable in |
111 [Yy][Ee][Ss]) | 111 [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) |
112 _ipv6_opts="${_ipv6_opts} accept_rtadv" 113 ;; 114 esac 115 fi 116 117 if [ -n "${_ipv6_opts}" ]; then 118 ifconfig $1 inet6 ${_ipv6_opts} 119 fi --- 260 unchanged lines hidden (view full) --- 380 _if=$1 381 382 case $_if in 383 pflog[0-9]*|\ 384 pfsync[0-9]*|\ 385 an[0-9]*|\ 386 ath[0-9]*|\ 387 ipw[0-9]*|\ | 112 _ipv6_opts="${_ipv6_opts} accept_rtadv" 113 ;; 114 esac 115 fi 116 117 if [ -n "${_ipv6_opts}" ]; then 118 ifconfig $1 inet6 ${_ipv6_opts} 119 fi --- 260 unchanged lines hidden (view full) --- 380 _if=$1 381 382 case $_if in 383 pflog[0-9]*|\ 384 pfsync[0-9]*|\ 385 an[0-9]*|\ 386 ath[0-9]*|\ 387 ipw[0-9]*|\ |
388 ipfw[0-9]*|\ |
|
388 iwi[0-9]*|\ 389 iwn[0-9]*|\ 390 ral[0-9]*|\ 391 wi[0-9]*|\ 392 wl[0-9]*|\ 393 wpi[0-9]*) 394 return 0 395 ;; --- 43 unchanged lines hidden (view full) --- 439# ipv6_autoconfif if 440# Returns 0 if the interface should be configured for IPv6 with 441# Stateless Address Configuration, 1 otherwise. 442ipv6_autoconfif() 443{ 444 local _if _tmpargs _arg 445 _if=$1 446 | 389 iwi[0-9]*|\ 390 iwn[0-9]*|\ 391 ral[0-9]*|\ 392 wi[0-9]*|\ 393 wl[0-9]*|\ 394 wpi[0-9]*) 395 return 0 396 ;; --- 43 unchanged lines hidden (view full) --- 440# ipv6_autoconfif if 441# Returns 0 if the interface should be configured for IPv6 with 442# Stateless Address Configuration, 1 otherwise. 443ipv6_autoconfif() 444{ 445 local _if _tmpargs _arg 446 _if=$1 447 |
447 if ! ipv6if $_if; then | 448 case $_if in 449 lo0|\ 450 stf[0-9]*|\ 451 faith[0-9]*|\ 452 lp[0-9]*|\ 453 sl[0-9]*) |
448 return 1 | 454 return 1 |
449 fi | 455 ;; 456 esac |
450 if noafif $_if; then 451 return 1 452 fi | 457 if noafif $_if; then 458 return 1 459 fi |
460 if ! ipv6if $_if; then 461 return 1 462 fi |
|
453 if checkyesno ipv6_gateway_enable; then 454 return 1 455 fi 456 _tmpargs=`get_if_var $_if ipv6_prefix_IF` 457 if [ -n "${_tmpargs}" ]; then 458 return 1 459 fi | 463 if checkyesno ipv6_gateway_enable; then 464 return 1 465 fi 466 _tmpargs=`get_if_var $_if ipv6_prefix_IF` 467 if [ -n "${_tmpargs}" ]; then 468 return 1 469 fi |
460 461 case $_if in 462 lo0|\ 463 stf[0-9]*|\ 464 faith[0-9]*|\ 465 lp[0-9]*|\ 466 sl[0-9]*|\ 467 pflog[0-9]*|\ 468 pfsync[0-9]*) 469 return 1 470 ;; 471 esac 472 | |
473 # backward compatibility: $ipv6_enable 474 case $ipv6_enable in | 470 # backward compatibility: $ipv6_enable 471 case $ipv6_enable in |
475 [Yy][Ee][Ss]) | 472 [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) |
476 return 0 | 473 return 0 |
477 ;; | 474 ;; |
478 esac 479 480 _tmpargs=`_ifconfig_getargs $_if ipv6` 481 for _arg in $_tmpargs; do 482 case $_arg in 483 accept_rtadv) 484 return 0 485 ;; --- 925 unchanged lines hidden --- | 475 esac 476 477 _tmpargs=`_ifconfig_getargs $_if ipv6` 478 for _arg in $_tmpargs; do 479 case $_arg in 480 accept_rtadv) 481 return 0 482 ;; --- 925 unchanged lines hidden --- |