Reduce code duplication for wlan(4) interface creation in network.subr.

Since wlandebug(8) can accept any (original or changed) interface name
this part may be simplified a bit.
This commit is contained in:
Andriy Voskoboinyk 2017-11-19 20:18:21 +00:00
parent e989c74331
commit c92451ae9d

View File

@ -1270,22 +1270,14 @@ wlan_up()
fi fi
if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then
${IFCONFIG_CMD} $child create ${create_args} && cfg=0 ${IFCONFIG_CMD} $child create ${create_args} && cfg=0
if [ $? -eq 0 ]; then
_list="$_list $child"
fi
if [ -n "${debug_flags}" ]; then
wlandebug -i $child ${debug_flags}
fi
else else
i=`${IFCONFIG_CMD} wlan create ${create_args}` ${IFCONFIG_CMD} wlan create ${create_args} name $child && cfg=0
# XXXGL: wlandebug should accept any name fi
if [ -n "${debug_flags}" ]; then if [ $? -eq 0 ]; then
wlandebug -i $i ${debug_flags} _list="$_list $child"
fi fi
${IFCONFIG_CMD} $i name $child && cfg=0 if [ -n "${debug_flags}" ]; then
if [ $? -eq 0 ]; then wlandebug -i $child ${debug_flags}
_list="$_list $child"
fi
fi fi
done done
done done