View | Details | Raw Unified | Return to bug 118111 | Differences between
and this patch

Collapse All | Expand All

(-)network.subr (-4 / +25 lines)
Lines 287-293 Link Here
287
	fi
287
	fi
288
288
289
	_if=$1
289
	_if=$1
290
	_punct=".-/+"
290
	_punct=".-/+:"
291
	ltr ${_if} "${_punct}" '_' _if
291
	ltr ${_if} "${_punct}" '_' _if
292
	_var=$2
292
	_var=$2
293
	_default=$3
293
	_default=$3
Lines 1589-1603 Link Here
1589
}
1589
}
1590
1590
1591
# ifnet_rename [ifname]
1591
# ifnet_rename [ifname]
1592
#	Rename interfaces if ifconfig_IF_name is defined.
1592
#	Rename interfaces if ifconfig_IF_name or ifconfig_ether_IF_name is defined.
1593
#
1593
#
1594
ifnet_rename()
1594
ifnet_rename()
1595
{
1595
{
1596
	local _if _ifname
1596
	local _if _ifname _ifether
1597
1597
1598
	# ifconfig_IF_name
1598
	# ifconfig_IF_name
1599
	for _if in ${*:-$(${IFCONFIG_CMD} -l)}; do
1599
	for _if in ${*:-$(${IFCONFIG_CMD} -l)}; do
1600
		_ifname=`get_if_var $_if ifconfig_IF_name`
1600
		_ifname=`get_if_var "$_if" ifconfig_IF_name`
1601
		_ifether=`get_etheraddr "$_if"`
1602
1603
		if [ ! -z "$_ifether" ]; then
1604
			_ifname=`get_if_var "$_ifether" ifconfig_ether_IF_name "$_ifname"`
1605
		fi
1606
1601
		if [ ! -z "$_ifname" ]; then
1607
		if [ ! -z "$_ifname" ]; then
1602
			${IFCONFIG_CMD} $_if name $_ifname
1608
			${IFCONFIG_CMD} $_if name $_ifname
1603
		fi
1609
		fi
Lines 1791-1793 Link Here
1791
		return
1797
		return
1792
	done
1798
	done
1793
}
1799
}
1800
1801
# get_etheraddr [ifname]
1802
#	 Echo the hwaddr for the interface, if any.
1803
#
1804
get_etheraddr()
1805
{
1806
	local _if proto addr rest
1807
	_if=$1
1808
	${IFCONFIG_CMD} "$_if" 2>/dev/null | while read proto addr rest; do
1809
		case "$proto" in
1810
		ether)
1811
			echo $addr
1812
		esac
1813
	done
1814
}

Return to bug 118111