when changing the mac address of a bridge interface, keep member interface addresses...
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 27 May 2010 14:04:28 +0000 (14:04 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 27 May 2010 14:04:28 +0000 (14:04 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21577 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/base-files/files/lib/network/config.sh

index 1a77145..32170bb 100755 (executable)
@@ -144,6 +144,8 @@ prepare_interface() {
        config_get iftype "$config" type
        case "$iftype" in
                bridge)
+                       local macaddr
+                       config_get macaddr "$config" macaddr
                        [ -x /usr/sbin/brctl ] && {
                                ifconfig "br-$config" 2>/dev/null >/dev/null && {
                                        local newdevs devices
@@ -168,7 +170,7 @@ prepare_interface() {
                                        # result in another setup_interface() call, so we simply stop processing
                                        # the current event at this point.
                                }
-                               ifconfig "$iface" up 2>/dev/null >/dev/null
+                               ifconfig "$iface" ${macaddr:+hw ether "${macaddr}"} up 2>/dev/null >/dev/null
                                return 1
                        }
                ;;
This page took 0.027755 seconds and 4 git commands to generate.