FreeBSD Bugzilla – Attachment 82574 Details for
Bug 118111
rc: network.subr Add MAC address based interface renaming
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.38 KB, created by
Thomas Hurst
on 2007-11-18 23:00:04 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Thomas Hurst
Created:
2007-11-18 23:00:04 UTC
Size:
1.38 KB
patch
obsolete
>--- network.subr.orig 2007-11-18 21:58:49.000000000 +0000 >+++ network.subr 2007-11-18 22:52:43.000000000 +0000 >@@ -585,18 +585,54 @@ > return $_ret > } > >+get_if_mac() >+{ >+ ifconfig $1 2>/dev/null | while read proto addr rest; do >+ case ${proto} in >+ ether) >+ echo $addr >+ esac >+ done >+} >+ > # ifnet_rename > # Rename all requested interfaces. > # > ifnet_rename() > { >- > _ifn_list="`ifconfig -l`" > [ -z "$_ifn_list" ] && return 0 > for _if in ${_ifn_list} ; do > _ifname=`get_if_var $_if ifconfig_IF_name` > if [ ! -z "$_ifname" ]; then > ifconfig $_if name $_ifname >+ # ifconfig returns EX_OK even if it fails >+ _if=$_ifname >+ fi >+ >+ if [ ! -z "$ifconfig_mac_names" ]; then >+ mac=`get_if_mac $_if | sed -e 's/[^a-f0-9]//g'` >+ if [ ! -z "$mac" ]; then >+ eval _ifmac_${mac}_name=$_if >+ fi >+ fi >+ done >+ >+ [ -z "$ifconfig_mac_names" ] && return 0 >+ for _ifname in ${ifconfig_mac_names} ; do >+ _ifmac=`get_if_var $_ifname ifconfig_mac_IF` >+ if [ ! -z "$_ifmac" ] ; then >+ _mac="`echo $_ifmac |tr '[:upper:]' '[:lower:]' |sed -e 's/[^a-f0-9]//g'`" >+ _if=`eval echo \\${_ifmac_${_mac}_name}` >+ if [ ! -z $_if ] ; then >+ if [ ! $_if = $_ifname ]; then >+ ifconfig $_if name $_ifname >+ fi >+ else >+ warn "Unable to locate interface with MAC $_ifmac for $_ifname" >+ fi >+ else >+ warn "MAC not configured for $_ifname, please set ifconfig_mac_${_ifname}" > fi > done > return 0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 118111
:
82574
|
82575
|
195121