Page MenuHomeFreeBSD

D49696.1792208075.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D49696.1792208075.diff

Index: libexec/rc/network.subr
===================================================================
--- libexec/rc/network.subr
+++ libexec/rc/network.subr
@@ -350,12 +350,17 @@
# boot time and 1 otherwise.
autoif()
{
- local _tmpargs _arg
+ local _tmpargs _arg _ifconfig_descr
_tmpargs=`_ifconfig_getargs $1`
for _arg in $_tmpargs; do
case $_arg in
[Nn][Oo][Aa][Uu][Tt][Oo])
+ _ifconfig_descr=`get_if_var $1 ifconfig_IF_descr`
+ if [ -n "${_ifconfig_descr}" ]; then
+ ${IFCONFIG_CMD} $1 description \
+ "${_ifconfig_descr}"
+ fi
return 1
;;
esac
@@ -1603,6 +1608,21 @@
return 0
}
+list_expanded_epair()
+{
+ if [ $# -ne 1 ]; then
+ err 3 'USAGE: list_expanded_epair needs ONE argument (epair#)'
+ return 1
+ fi
+ case ${1#epair} in
+ [0-9]*[ab]) echo ${1} ;;
+ [0-9]*) echo ${1}a ${1}b ;;
+ *) return 1 ;;
+ esac
+
+ return 0
+}
+
# list_net_interfaces type
# List all network interfaces. The type of interface returned
# can be controlled by the type argument. The type
Index: libexec/rc/rc.d/netif
===================================================================
--- libexec/rc/rc.d/netif
+++ libexec/rc/rc.d/netif
@@ -52,7 +52,7 @@
netif_start()
{
- local _if
+ local _if _cmdifn _ifname
# Set the list of interfaces to work on.
#
@@ -75,6 +75,14 @@
# Rename interfaces.
ifnet_rename $cmdifn
+ # Adjust $cmdifn if defined (devd(8) etc.)
+ for _if in ${cmdifn}; do
+ _ifname=`get_if_var $_if ifconfig_IF_name`
+ _cmdifn="${_cmdifn}${_cmdifn:+ }${_ifname:-$_if}"
+ done
+ if [ -n "$_cmdifn" ]; then
+ cmdifn="$_cmdifn"
+ fi
# Configure the interface(s).
netif_common ifn_start $cmdifn
@@ -155,7 +163,7 @@
# an interface and then calls $routine.
netif_common()
{
- local _cooked_list _tmp_list _fail _func _ok _str _cmdifn
+ local _cooked_list _fail _func _ok _str _cmdifn
_func=
@@ -166,36 +174,34 @@
shift
fi
- # Set the scope of the command (all interfaces or just one).
- #
- _cooked_list=
- _tmp_list=
- _cmdifn=$*
- if [ -n "$_cmdifn" ]; then
- # Don't check that the interface(s) exist. We need to run
- # the down code even when the interface doesn't exist to
- # kill off wpa_supplicant.
- # XXXBED: is this really true or does wpa_supplicant die?
- # if so, we should get rid of the devd entry
- _cooked_list="$_cmdifn"
- else
+ _cmdifn= # inherited from parent function
+ # Define _cmdifn from rest of $*
+ for _if in $*; do
+ # Expand epair if passed as argument
+ if [ ${_if#epair} != $_if ]; then
+ _ok="`list_expanded_epair $_if`"
+ if [ -n "$_ok" ]; then
+ _if="$_ok"
+ fi
+ fi
+ _cmdifn="$_cmdifn${_cmdifn:+ }$_if"
+ done
+ # Don't check that the interface(s) exist. We need to run
+ # the down code even when the interface doesn't exist to
+ # kill off wpa_supplicant.
+ # XXXBED: is this really true or does wpa_supplicant die?
+ # if so, we should get rid of the devd entry
+ if [ -z "${_cmdifn# }" ]; then
_cooked_list="`list_net_interfaces`"
fi
-
- # Expand epair[0-9] to epair[0-9][ab].
- for ifn in $_cooked_list; do
- case ${ifn#epair} in
- [0-9]*[ab]) ;; # Skip epair[0-9]*[ab].
- [0-9]*)
- for _str in $_cooked_list; do
- case $_str in
- $ifn) _tmp_list="$_tmp_list ${ifn}a ${ifn}b" ;;
- *) _tmp_list="$_tmp_list ${ifn}" ;;
- esac
- done
- _cooked_list=${_tmp_list# }
- ;;
- esac
+ # virtually else
+ for _if in $_cmdifn; do
+ if ! autoif $_if; then
+ continue
+ elif [ -z "`ifconfig_getargs $_if`" ]; then
+ continue
+ fi
+ _cooked_list="$_cooked_list${_cooked_list:+ }$_if"
done
_dadwait=

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 17, 3:34 AM (7 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30452291
Default Alt Text
D49696.1792208075.diff (3 KB)

Event Timeline