Index: etc/network.subr =================================================================== --- etc/network.subr +++ etc/network.subr @@ -1245,6 +1245,24 @@ fi } +# child_wlans if +# Outputs list of child wlan devices for the $if interface. +# +child_wlans() +{ + local wlans + + wlans=`get_if_var $1 wlans_IF` + info "initial wlans for $1: \"$wlans\"" + if [ -z "$wlans" ]; then + wlans="$1" + elif [ "$wlans" = "NONE" ]; then + wlans= + fi + info "final wlans for $1: \"$wlans\"" + echo "$wlans" +} + # wlan_up # Create IEEE802.11 interfaces. # @@ -1254,9 +1272,11 @@ _list= _iflist=$* + info "wlan_up:" "$@" + # Parse wlans_$parent="$child ..." for parent in `set | sed -nE 's/wlans_([a-z]+[0-9]+)=.*/\1/p'`; do - child_wlans=`get_if_var $parent wlans_IF` + child_wlans=`child_wlans $parent` for child in ${child_wlans}; do create_args="wlandev $parent `get_if_var $child create_args_IF`" debug_flags="`get_if_var $child wlandebug_IF`" @@ -1298,7 +1318,7 @@ # Parse wlans_$parent="$child ..." for parent in `set | sed -nE 's/wlans_([a-z]+[0-9]+)=.*/\1/p'`; do - child_wlans=`get_if_var $parent wlans_IF` + child_wlans=`child_wlans $parent` for child in ${child_wlans}; do case $_iflist in ""|$child|$child\ *|*\ $child\ *|*\ $child) ;; @@ -1479,12 +1499,17 @@ ifn=$1 # Create wireless interfaces - child_wlans=`get_if_var $ifn wlans_IF` + child_wlans=`child_wlans $ifn` for child in ${child_wlans}; do create_args="wlandev $ifn `get_if_var $child create_args_IF`" debug_flags="`get_if_var $child wlandebug_IF`" + # Skip if ${child} already exists. + if ${IFCONFIG_CMD} $child > /dev/null 2>&1; then + continue + fi + if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then ${IFCONFIG_CMD} $child create ${create_args} && cfg=0 if [ -n "${debug_flags}" ]; then @@ -1539,7 +1564,7 @@ local cfg child child_vlans child_wlans ifn cfg=1 - child_wlans=`get_if_var $ifn wlans_IF` + child_wlans=`child_wlans $ifn` for child in ${child_wlans}; do if ! ifexists $child; then continue Index: etc/pccard_ether =================================================================== --- etc/pccard_ether +++ etc/pccard_ether @@ -72,6 +72,8 @@ { ifexists $ifn || exit 1 + /etc/rc.d/bridge quietstart $ifn + if [ -z "$rc_force" ]; then for uif in `ifconfig -ul`; do if [ "${uif}" = "${ifn}" ]; then @@ -103,6 +105,7 @@ fi /etc/rc.d/netif quietstop $ifn + /etc/rc.d/bridge quietstop $ifn # clean ARP table ifexists $ifn && arp -d -i $ifn -a @@ -119,7 +122,7 @@ pccard_ether_startchildren() { - for child in `get_if_var $ifn wlans_IF`; do + for child in `child_wlans $ifn`; do if ifexists $child; then continue fi @@ -129,7 +132,7 @@ pccard_ether_stopchildren() { - for child in `get_if_var $ifn wlans_IF`; do + for child in `child_wlans $ifn`; do /etc/rc.d/netif quietstop $child done }