aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-12-04 23:22:06 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-12-04 23:22:06 +0000
commit7cc6503877d0cbb271b257d8f852f150a7acc7c4 (patch)
treee2723b9ed1138d0f942371803c57b0d86e6d5a13
parent20e82c48efd9e560f9323f70e53e75c4a2025bd4 (diff)
downloadupstream-7cc6503877d0cbb271b257d8f852f150a7acc7c4.tar.gz
upstream-7cc6503877d0cbb271b257d8f852f150a7acc7c4.tar.bz2
upstream-7cc6503877d0cbb271b257d8f852f150a7acc7c4.zip
add option for setting the mac address (#1014)
SVN-Revision: 5690
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 90f5bf7424..8188203d31 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -66,6 +66,7 @@ setup_interface() {
local iface="$1"
local config="$2"
local proto
+ local macaddr
[ -n "$config" ] || {
config=$(find_config "$iface")
@@ -76,7 +77,8 @@ setup_interface() {
config_get iftype "$config" type
ifconfig "$iface" 2>/dev/null >/dev/null && {
- # make sure the interface is removed from any existing bridge
+ # make sure the interface is removed from any existing bridge and brought down
+ ifconfig "$iface" down
unbridge "$iface"
}
@@ -101,7 +103,8 @@ setup_interface() {
# Interface settings
config_get mtu "$config" mtu
- $DEBUG ifconfig "$iface" ${mtu:+mtu $mtu} up
+ config_get macddr "$config" macaddr
+ $DEBUG ifconfig "$iface" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
pidfile="/var/run/$iface.pid"
case "$proto" in