]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
tools/hotplug/Linux: only apply dummy MAC address to virtual devices.
authorIan Campbell <ian.campbell@citrix.com>
Tue, 4 Jan 2011 15:26:02 +0000 (15:26 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 4 Jan 2011 15:26:02 +0000 (15:26 +0000)
Avoid applying to the bridge and physical network device.

This should un-break dom0 networking in the old xend-creates-bridge
setup (problem introduced in 22493:937488219719).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/hotplug/Linux/network-bridge
tools/hotplug/Linux/vif-bridge
tools/hotplug/Linux/vif2
tools/hotplug/Linux/xen-network-common.sh

index 035a58d8e2f259430bfe70a31b97152f37e61878..6f8475acb725d5b4028eec663928d376c6e5b93e 100644 (file)
@@ -244,7 +244,7 @@ op_start () {
     ip link set ${netdev} name ${pdev}
     ip link set ${tdev} name ${bridge}
 
-    setup_bridge_port ${pdev}
+    setup_physical_bridge_port ${pdev}
 
     # Restore slaves
     if [ -n "${slaves}" ]; then
index b48e1276940d7cf6f0fcb77bbdd93153a72d4005..1cbdd8af616ea0c17f80b5be66e83c8c0f1b22c1 100644 (file)
@@ -81,7 +81,7 @@ fi
 
 case "$command" in
     online)
-        setup_bridge_port "$dev"
+        setup_virtual_bridge_port "$dev"
         add_to_bridge "$bridge" "$dev"
         ;;
 
@@ -91,7 +91,7 @@ case "$command" in
         ;;
 
     add)
-        setup_bridge_port "$dev"
+        setup_virtual_bridge_port "$dev"
         add_to_bridge "$bridge" "$dev"
         ;;
 esac
index 247fa67acf3edb1dce7975a8a5e2f68cb8d4d383..2c155be68c2c785e4b8ef45b4cb00f301deb340d 100644 (file)
@@ -23,7 +23,7 @@ case "$command" in
     "online")
        if [ "$bridge" != "-" ]
            then
-           setup_bridge_port "$vif"
+           setup_virtual_bridge_port "$vif"
            add_to_bridge "$bridge" "$vif"
        else
            # Just let the normal udev rules for interfaces handle it.
index 1100757c82bb37ebd0cc9733eb9e0f6c764ba8f0..8cff156d29b94d3692392a8228ec86cb68cf0007 100644 (file)
@@ -80,22 +80,32 @@ find_dhcpd_arg_file()
 }
 
 # configure interfaces which act as pure bridge ports:
-setup_bridge_port() {
+_setup_bridge_port() {
     local dev="$1"
+    local virtual="$2"
 
     # take interface down ...
     ip link set ${dev} down
 
-    # Initialise a dummy MAC address. We choose the numerically
-    # largest non-broadcast address to prevent the address getting
-    # stolen by an Ethernet bridge for STP purposes.
-    # (FE:FF:FF:FF:FF:FF)
-    ip link set ${dev} address fe:ff:ff:ff:ff:ff || true
+    if [ $virtual -ne 0 ] ; then
+        # Initialise a dummy MAC address. We choose the numerically
+        # largest non-broadcast address to prevent the address getting
+        # stolen by an Ethernet bridge for STP purposes.
+        # (FE:FF:FF:FF:FF:FF)
+        ip link set ${dev} address fe:ff:ff:ff:ff:ff || true
+    fi
 
     # ... and configure it
     ip addr flush ${dev}
 }
 
+setup_physical_bridge_port() {
+    _setup_bridge_port $1 0
+}
+setup_virtual_bridge_port() {
+    _setup_bridge_port $1 1
+}
+
 # Usage: create_bridge bridge
 create_bridge () {
     local bridge=$1