]> xenbits.xensource.com Git - libvirt.git/commit
Set a stable & high MAC addr for guest TAP devices on host
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 21 Jul 2010 10:08:52 +0000 (11:08 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 23 Jul 2010 09:15:04 +0000 (10:15 +0100)
commit6ea90b843eff95be6bcbb49a327656fc6f6445ef
tree3e5b4be9f4f6cc15ee1b078c51a6e124702476b1
parent020d220421516347944ad9ea54b5f04e0ced07b7
Set a stable & high MAC addr for guest TAP devices on host

A Linux software bridge will assume the MAC address of the enslaved
interface with the numerically lowest MAC addr. When the bridge
changes MAC address there is a period of network blackout, so a
change should be avoided. The kernel gives TAP devices a completely
random MAC address. Occassionally the random TAP device MAC is lower
than that of the physical interface (eth0, eth1etc) that is enslaved,
causing the bridge to change its MAC.

This change sets an explicit MAC address for all TAP devices created
using the configured MAC from the XML, but with the high byte set
to 0xFE. This should ensure TAP device MACs are higher than any
physical interface MAC.

* src/qemu/qemu_conf.c, src/uml/uml_conf.c: Pass in a MAC addr
  for the TAP device with high byte set to 0xFE
* src/util/bridge.c, src/util/bridge.h: Set a MAC when creating
  the TAP device to override random MAC
src/qemu/qemu_conf.c
src/uml/uml_conf.c
src/util/bridge.c
src/util/bridge.h