FreeBSD Bugzilla – Attachment 195121 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]
Patch against CURRENT
network.subr.patch (text/plain), 1.17 KB, created by
Thomas Hurst
on 2018-07-13 23:37:54 UTC
(
hide
)
Description:
Patch against CURRENT
Filename:
MIME Type:
Creator:
Thomas Hurst
Created:
2018-07-13 23:37:54 UTC
Size:
1.17 KB
patch
obsolete
>--- network.subr.orig 2018-07-13 22:13:28.281892380 +0100 >+++ network.subr 2018-07-14 00:07:09.764421472 +0100 >@@ -287,7 +287,7 @@ > fi > > _if=$1 >- _punct=".-/+" >+ _punct=".-/+:" > ltr ${_if} "${_punct}" '_' _if > _var=$2 > _default=$3 >@@ -1589,15 +1589,21 @@ > } > > # ifnet_rename [ifname] >-# Rename interfaces if ifconfig_IF_name is defined. >+# Rename interfaces if ifconfig_IF_name or ifconfig_ether_IF_name is defined. > # > ifnet_rename() > { >- local _if _ifname >+ local _if _ifname _ifether > > # ifconfig_IF_name > for _if in ${*:-$(${IFCONFIG_CMD} -l)}; do >- _ifname=`get_if_var $_if ifconfig_IF_name` >+ _ifname=`get_if_var "$_if" ifconfig_IF_name` >+ _ifether=`get_etheraddr "$_if"` >+ >+ if [ ! -z "$_ifether" ]; then >+ _ifname=`get_if_var "$_ifether" ifconfig_ether_IF_name "$_ifname"` >+ fi >+ > if [ ! -z "$_ifname" ]; then > ${IFCONFIG_CMD} $_if name $_ifname > fi >@@ -1791,3 +1797,18 @@ > return > done > } >+ >+# get_etheraddr [ifname] >+# Echo the hwaddr for the interface, if any. >+# >+get_etheraddr() >+{ >+ local _if proto addr rest >+ _if=$1 >+ ${IFCONFIG_CMD} "$_if" 2>/dev/null | while read proto addr rest; do >+ case "$proto" in >+ ether) >+ echo $addr >+ esac >+ done >+}
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