Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164320942
D49696.id153267.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D49696.id153267.diff
View Options
Index: libexec/rc/network.subr
===================================================================
--- libexec/rc/network.subr
+++ libexec/rc/network.subr
@@ -112,6 +112,15 @@
return $_cfg
}
+ifconfig_description()
+{
+ local _ifconfig_descr
+ _ifconfig_descr=`get_if_var $1 ifconfig_IF_descr`
+ if [ -n "${_ifconfig_descr}" ]; then
+ ${IFCONFIG_CMD} $1 description "${_ifconfig_descr}"
+ fi
+}
+
# ifconfig_up if
# Evaluate ifconfig(8) arguments for interface $if and
# run ifconfig(8) with those arguments. It returns 0 if
@@ -121,7 +130,7 @@
#
ifconfig_up()
{
- local _cfg _ifconfig_descr _ipv6_opts ifconfig_args
+ local _cfg _ipv6_opts ifconfig_args
_cfg=1
# Make sure lo0 always comes up.
@@ -211,11 +220,6 @@
ifalias $1 link alias
ifalias $1 ether alias
- _ifconfig_descr=`get_if_var $1 ifconfig_IF_descr`
- if [ -n "${_ifconfig_descr}" ]; then
- ${IFCONFIG_CMD} $1 description "${_ifconfig_descr}"
- fi
-
if wpaif $1; then
/etc/rc.d/wpa_supplicant start $1
_cfg=0 # XXX: not sure this should count
@@ -1637,6 +1641,10 @@
else
_tmplist="${_tmplist} ${_if}"
fi
+ else
+ # All list type requests but 'skip' will re-
+ # define $_list, collect excluded $_if
+ _list="$_list${_list:+ }$_if"
fi
done
_tmplist="${_lo}${_tmplist# }"
@@ -1701,6 +1709,8 @@
fi
done
;;
+ skip) # !autoif() was collected in $_list
+ ;;
*)
_list=${_tmplist}
;;
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 _ifconfig_descr
_func=
@@ -166,36 +174,56 @@
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
+ if [ -z "${_cmdifn# }" ] && [ X$_func != Xifn_start ]; then
+ # If interface description is configured, also process inter-
+ # faces which are skipped from auto config otherwise (NOAUTO),
+ # but only if $_func=ifn_start
+ for _if in `list_net_interfaces skip` ${_cooked_list# }; do
+ _ifconfig_descr=`get_if_var $_if ifconfig_IF_descr`
+ if [ -n "${_ifconfig_descr}" ]; then
+ ${IFCONFIG_CMD} $_if description \
+ "${_ifconfig_descr}"
+ fi
done
- _cooked_list=${_tmp_list# }
- ;;
- esac
+ fi
+ # virtually else [ -z "${_cmdifn# }" ]
+ for _if in $_cmdifn; do
+ if [ X$_func != Xifn_start ]; then
+ _ifconfig_descr=
+ else
+ _ifconfig_descr=`get_if_var $_if ifconfig_IF_descr`
+ fi
+ # If interface description is configured (and $_func=ifn_start),
+ # here's the place to apply for all selectivly listed interfaces
+ if [ -n "${_ifconfig_descr}" ]; then
+ ${IFCONFIG_CMD} $_if description "${_ifconfig_descr}"
+ fi
+ if ! autoif $_if; then
+ continue
+ elif [ -z "`ifconfig_getargs $_if`" ]; then
+ continue
+ fi
+ _cooked_list="$_cooked_list${_cooked_list:+ }$_if"
done
_dadwait=
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 31, 6:38 PM (14 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35793258
Default Alt Text
D49696.id153267.diff (4 KB)
Attached To
Mode
D49696: Fix renaming epair and devd(8) triggered interfaces and auto-NOAUTO the latter by default
Attached
Detach File
Event Timeline
Log In to Comment