WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] tools/hotplug/Linux: Ensure tap devices receive

To: Keir Fraser <keir@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH] tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Thu, 16 Dec 2010 10:17:33 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Thu, 16 Dec 2010 02:18:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C92E484C.28F9F%keir@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <C92E484C.28F9F%keir@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2010-12-15 at 10:26 +0000, Keir Fraser wrote:
> On 10/12/2010 18:44, "Ian Jackson" <Ian.Jackson@xxxxxxxxxxxxx> wrote:
> 
> > Ian Campbell writes ("[Xen-devel] [PATCH] tools/hotplug/Linux: Ensure tap
> > devices receive a dummy MAC address"):
> >> tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address.
> > 
> > Thanks, I have applied this.
> > 
> > Keir, I think this one is a backport candidate for 4.0 assuming the
> > tests pass.
> 
> The -unstable patch does not apply to 4.0-testing. It will need to be
> manually backported and then submitted to xen-devel for inclusion.

xen-4.0-testing doesn't have the patches which cause us to use the
hotplug scripts for tap devices, so this patch is not directly
applicable.

I think the equivalent fix for that branch would be in
qemu-xen-4.0-testing.git instead:

8<-----------------------------------------

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@xxxxxxxxxx>
diff --git a/i386-dm/qemu-ifup-Linux b/i386-dm/qemu-ifup-Linux
index bcbee92..99ddae7 100644
--- a/i386-dm/qemu-ifup-Linux
+++ b/i386-dm/qemu-ifup-Linux
@@ -33,5 +33,6 @@ then
    fi
 fi
 
+ifconfig $1 hw ether fe:ff:ff:ff:ff:ff
 ifconfig $1 0.0.0.0 up
 brctl addif $bridge $1 || true



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel