]> xenbits.xensource.com Git - libvirt.git/commit
util: fail attempts to use same mac address for guest and tap
authorLaine Stump <laine@laine.org>
Mon, 5 Mar 2012 00:21:16 +0000 (19:21 -0500)
committerLaine Stump <laine@laine.org>
Tue, 20 Mar 2012 00:33:30 +0000 (20:33 -0400)
commit5d57104538297a7e5dab21f9b7ca8070b80c24fb
treee2347c043fcfa56bcf6b113f5dd407cc04331f7f
parentd675a922b5cd886b7ddd5610e97097d0c3707016
util: fail attempts to use same mac address for guest and tap

This patch is in response to:

  https://bugzilla.redhat.com/show_bug.cgi?id=798467

If a guest's tap device is created using the same MAC address the
guest uses for its own network card (which connects to the tap
device), the Linux kernel will log the following message and traffic
will not pass:

 kernel: vnet9: received packet with own address as source address

This patch disallows MAC addresses with a first byte of 0xFE, but only in
the case that the MAC address is used for a guest interface that's
connected by way of a standard tap device. (In other words, the
validation is done at runtime at the same place the MAC address is
modified for the tap device, rather than when mac address is parsed,
the idea being that it is then we know for sure the address will be
problematic.)
src/util/virnetdevtap.c