aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hotplug
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-10 18:44:07 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-10 18:44:07 +0000
commit6824dea08ba299dc8edba18ffc73e79131f655b6 (patch)
treeff97912cbbe3c77bf8a3280dfe57304a9ff0d677 /tools/hotplug
parent1e48dfc63c0e21b6aab3d72846a4f17c45004027 (diff)
downloadxen-6824dea08ba299dc8edba18ffc73e79131f655b6.tar.gz
xen-6824dea08ba299dc8edba18ffc73e79131f655b6.tar.bz2
xen-6824dea08ba299dc8edba18ffc73e79131f655b6.zip
tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address.
If a tap device is not given an explicit MAC address it will generate one randomly. The behaviour of the Linux bridge is to pickup the lowest MAC address of any port for use in for ARP, STP etc. If the tap device's randomly generated MAC address happens to be the lowest then this can cause all manner of strange networking glitches in both domain 0 and guests when the bridge suddenly takes over from the previously used MAC address. We choose FE:FF:FF:FF:FF:FF as it the numerically largest non-broadcast address. This ensures that the physical NIC device's port will have the lowest MAC address and therefore be the one picked up by the bridge. vif devices already have a MAC address of FE:FF:FF:FF:FF:FF set by netback already but there is no harm in forcing it a second time in the hotplug script. tap devices are added by the "add" event and therefore we should call setup_bridge_port then as well as for "online" which is caused by vif devices. 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>
Diffstat (limited to 'tools/hotplug')
-rw-r--r--tools/hotplug/Linux/vif-bridge1
-rw-r--r--tools/hotplug/Linux/xen-network-common.sh6
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index 82ba676202..b48e127694 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -91,6 +91,7 @@ case "$command" in
;;
add)
+ setup_bridge_port "$dev"
add_to_bridge "$bridge" "$dev"
;;
esac
diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linux/xen-network-common.sh
index 7014333df0..3157a10618 100644
--- a/tools/hotplug/Linux/xen-network-common.sh
+++ b/tools/hotplug/Linux/xen-network-common.sh
@@ -86,6 +86,12 @@ setup_bridge_port() {
# 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
+
# ... and configure it
ip addr flush ${dev}
}