Deleted Added
full compact
25c25
< # $FreeBSD: head/etc/network.subr 152441 2005-11-14 23:34:50Z brooks $
---
> # $FreeBSD: head/etc/network.subr 157706 2006-04-13 06:50:46Z brooks $
47c47
< eval "ifconfig $1 ${ifconfig_args}"
---
> ifconfig $1 ${ifconfig_args}
63c63,65
< /etc/rc.d/dhclient start $1
---
> if syncdhcpif $1; then
> /etc/rc.d/dhclient start $1
> fi
74a77,78
> # XXX: should not be only inet
> #
107a112,113
> ifconfig $1 down
>
110a117,141
> # get_if_var if var [default]
> # Return the value of the pseudo-hash corresponding to $if where
> # $var is a string containg the sub-string "IF" which will be
> # replaced with $if after the characters defined in _punct are
> # replaced with '_'. If the variable is unset, replace it with
> # $default if given.
> get_if_var()
> {
> if [ $# -ne 2 -a $# -ne 3 ]; then
> err 3 'USAGE: get_if_var name var [default]'
> fi
>
> _if=$1
> _punct=". - / +"
> for _punct_c in $punct; do
> _if=`ltr ${_if} ${_punct_c} '_'`
> done
> _var=$2
> _default=$3
>
> prefix=${_var%%IF*}
> suffix=${_var##*IF}
> eval echo \${${prefix}${_if}${suffix}-${_default}}
> }
>
122,124c153
< eval _args=\${ifconfig_$1-$ifconfig_DEFAULT}
<
< echo "$_args"
---
> get_if_var $_ifn ifconfig_IF "$ifconfig_DEFAULT"
140,145c169,173
< [Dd][Hh][Cc][Pp])
< ;;
< [Nn][Oo][Aa][Uu][Tt][Oo])
< ;;
< [Ww][Pp][Aa])
< ;;
---
> [Dd][Hh][Cc][Pp]) ;;
> [Nn][Oo][Aa][Uu][Tt][Oo]) ;;
> [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
> [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
> [Ww][Pp][Aa]) ;;
180a209,214
> [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
> return 0
> ;;
> [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
> return 0
> ;;
185a220,242
> # syncdhcpif
> # Returns 0 if the interface should be configured synchronously and
> # 1 otherwise.
> syncdhcpif()
> {
> _tmpargs=`_ifconfig_getargs $1`
> for _arg in $_tmpargs; do
> case $_arg in
> [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
> return 1
> ;;
> [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
> return 0
> ;;
> esac
> done
> if checkyesno syncronous_dhclient; then
> return 0
> else
> return 1
> fi
> }
>
229c286
< eval cidr_addr=\${ipv4_addrs_${_if}}
---
> cidr_addr=`get_if_var $_if ipv4_addrs_IF`
269c326
< eval ifconfig_args=\$ifconfig_$1_alias${alias}
---
> ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
291c348
< eval ifconfig_args=\$ifconfig_$1_alias${alias}
---
> ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
370c427
< eval peers=\$gifconfig_$i
---
> peers=`get_if_var $i gifconfig_IF`
394c451
< eval ifconfig_args=\$ifconfig_${ifn}_ipx
---
> ifconfig_args=`get_if_var $ifn ifconfig_IF_ipx`
441c498
< eval _ifname=\$ifconfig_${_if}_name
---
> _ifname=`get_if_var $_if ifconfig_IF_name`
502c559
< elif [ -n "`_ifconfig_getargs $if`" ]; then
---
> elif [ -n "`_ifconfig_getargs $_if`" ]; then
567c624
< eval prefix=\$ipv6_prefix_$i
---
> prefix=`get_if_var $i ipv6_prefix_IF`
587c644
< eval ipv6_ifconfig=\$ipv6_ifconfig_$i
---
> ipv6_ifconfig=`get_if_var $i ipv6_ifconfig_IF`
622c679
< eval ipv6_ifconfig=\$ipv6_ifconfig_${i}_alias${alias}
---
> ipv6_ifconfig=`get_if_var $i ipv6_ifconfig_IF_alias${alias}`
698c755
< eval ipv6_route_args=\$ipv6_route_${i}
---
> ipv6_route_args=`get_if_var $i ipv6_route_IF`