X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/b80bf0c001df10c7232c0e58cf386db413903a1c..bc175c58b05a52549cf259c9a8cc455d63f5fa63:/package/base-files/files/lib/network/config.sh diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh index 9b4320507..0ab46c18a 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