aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-03-25 19:13:15 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-03-25 19:13:15 +0000
commit9a72419724bce9b5b464680101d13a877380ee81 (patch)
tree594c903919e173a6d9ea2855a42e96bfb3af1280 /package/base-files/files/lib
parent95d95a757bd197069a17855e935781300c91a756 (diff)
downloadupstream-9a72419724bce9b5b464680101d13a877380ee81.tar.gz
upstream-9a72419724bce9b5b464680101d13a877380ee81.tar.bz2
upstream-9a72419724bce9b5b464680101d13a877380ee81.zip
- fix mac assignment for broadcom vifs in bridging mode - thanks abramoff1 for spotting this - fix possible regression with different interface protocols - bump PKG_RELEASE
SVN-Revision: 15042
Diffstat (limited to 'package/base-files/files/lib')
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 29b7fe5c13..0ab46c18af 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -83,6 +83,7 @@ sort_list() {
prepare_interface() {
local iface="$1"
local config="$2"
+ local vifmac="$3"
# if we're called for the bridge interface itself, don't bother trying
# to create any interfaces here. The scripts have already done that, otherwise
@@ -93,6 +94,12 @@ prepare_interface() {
# make sure the interface is removed from any existing bridge and deconfigured
ifconfig "$iface" 0.0.0.0
unbridge "$iface"
+
+ # Change interface MAC address if requested
+ [ -n "$vifmac" ] && {
+ ifconfig "$iface" down
+ ifconfig "$iface" hw ether "$vifmac" up
+ }
}
# Setup VLAN interfaces
@@ -209,6 +216,7 @@ setup_interface_alias() {
setup_interface() {
local iface="$1"
local config="$2"
+ local vifmac="$4"
local proto
local macaddr
@@ -218,7 +226,7 @@ setup_interface() {
}
proto="${3:-$(config_get "$config" proto)}"
- prepare_interface "$iface" "$config" || return 0
+ prepare_interface "$iface" "$config" "$vifmac" || return 0
[ "$iface" = "br-$config" ] && {
# need to bring up the bridge and wait a second for
@@ -231,7 +239,6 @@ setup_interface() {
# Interface settings
config_get mtu "$config" mtu
config_get macaddr "$config" macaddr
- macaddr="${macaddr:-$3}"
grep "$iface:" /proc/net/dev > /dev/null && \
$DEBUG ifconfig "$iface" down && \
$DEBUG ifconfig "$iface" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up