This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-unstable] tools/hotplug/Linux: Ensure tap devices r

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Dec 2010 05:33:49 -0800
Delivery-date: Thu, 23 Dec 2010 05:37:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1292006647 0
# Node ID 9374882197196ab3208a584c4393bfad4a24ae83
# Parent  7228b46eb2b7e1bc6b5d5966cfa15317eb238f1e
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

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
 tools/hotplug/Linux/vif-bridge            |    1 +
 tools/hotplug/Linux/xen-network-common.sh |    6 ++++++
 2 files changed, 7 insertions(+)

diff -r 7228b46eb2b7 -r 937488219719 tools/hotplug/Linux/vif-bridge
--- a/tools/hotplug/Linux/vif-bridge    Fri Dec 10 18:30:45 2010 +0000
+++ b/tools/hotplug/Linux/vif-bridge    Fri Dec 10 18:44:07 2010 +0000
@@ -91,6 +91,7 @@ case "$command" in
+        setup_bridge_port "$dev"
         add_to_bridge "$bridge" "$dev"
diff -r 7228b46eb2b7 -r 937488219719 tools/hotplug/Linux/xen-network-common.sh
--- a/tools/hotplug/Linux/xen-network-common.sh Fri Dec 10 18:30:45 2010 +0000
+++ b/tools/hotplug/Linux/xen-network-common.sh Fri Dec 10 18:44:07 2010 +0000
@@ -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}

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address., Xen patchbot-unstable <=