Miroslav Rezanina
2010-Dec-21 13:13 UTC
[Xen-devel] [PATCH][qemu-xen] Change tap device mac address to prevent change of bridge''s mac
Qemu tap device is created with random mac address and then add to bridge. Due to linux kernel handlig, bridge change its mac address to tap mac in case tap mac is lower than bridge one. This can lead to short network breakage for dom0 and guests. This patch set tap device mac adress to FE:FF:FF:FF:FF:FF to ensure tap device mac is always higher then bridge one. Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Patch: -- diff --git a/i386-dm/qemu-ifup-Linux b/i386-dm/qemu-ifup-Linux index bcbee92..c706a10 100644 --- a/i386-dm/qemu-ifup-Linux +++ b/i386-dm/qemu-ifup-Linux @@ -33,5 +33,8 @@ then fi fi +# We have to change mac address of tap device to not change bridge mac +ip link set $1 addr fe:ff:ff:ff:ff:ff + ifconfig $1 0.0.0.0 up brctl addif $bridge $1 || true -- Miroslav Rezanina Software Engineer - Virtualization Team - XEN kernel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2010-Dec-21 13:36 UTC
Re: [Xen-devel] [PATCH][qemu-xen] Change tap device mac address to prevent change of bridge''s mac
On Tue, 2010-12-21 at 13:13 +0000, Miroslav Rezanina wrote:> Qemu tap device is created with random mac address and then add to bridge. Due to linux kernel handlig, bridge change its mac address to tap mac in case tap mac is lower than bridge one. This can lead to short network breakage for dom0 and guests. > > This patch set tap device mac adress to FE:FF:FF:FF:FF:FF to ensure tap device mac is always higher then bridge one. > > Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>Thanks. This needed a different fix in xen-unstable.hg because tap devices are handled by the hotplug scripts and not qemu-ifup there. See the recent thread "tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address". My backport to xen-4.0-testing looked a lot like yours. Ian.> > Patch: > -- > diff --git a/i386-dm/qemu-ifup-Linux b/i386-dm/qemu-ifup-Linux > index bcbee92..c706a10 100644 > --- a/i386-dm/qemu-ifup-Linux > +++ b/i386-dm/qemu-ifup-Linux > @@ -33,5 +33,8 @@ then > fi > fi > > +# We have to change mac address of tap device to not change bridge mac > +ip link set $1 addr fe:ff:ff:ff:ff:ff > + > ifconfig $1 0.0.0.0 up > brctl addif $bridge $1 || true_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jan-05 23:43 UTC
Re: [Xen-devel] [PATCH][qemu-xen] Change tap device mac address to prevent change of bridge''s mac
Ian Campbell writes ("Re: [Xen-devel] [PATCH][qemu-xen] Change tap device mac address to prevent change of bridge''s mac"):> On Tue, 2010-12-21 at 13:13 +0000, Miroslav Rezanina wrote: > > Qemu tap device is created with random mac address and then add to bridge. Due to linux kernel handlig, bridge change its mac address to tap mac in case tap mac is lower than bridge one. This can lead to short network breakage for dom0 and guests. > > > > This patch set tap device mac adress to FE:FF:FF:FF:FF:FF to ensure tap device mac is always higher then bridge one. > > > > Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> > > Thanks. This needed a different fix in xen-unstable.hg because tap > devices are handled by the hotplug scripts and not qemu-ifup there. See > the recent thread "tools/hotplug/Linux: Ensure tap devices receive a > dummy MAC address". > > My backport to xen-4.0-testing looked a lot like yours.Thanks for that, I''ve applied Miroslav''s patch to qemu-xen-4.0-testing.git. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel