bhyve code question, pci_virtio_net.c

Allan Jude allanjude at
Sat May 16 17:01:50 UTC 2015

While looking at the code, I noticed the following comment:

	 * The default MAC address is the standard NetApp OUI of 00-a0-98,
	 * followed by an MD5 of the PCI slot/func number and dev name
	if (!mac_provided) {
		snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot,
		    pi->pi_func, vmname);

which raised 2 questions:
1) According to the comment, the mac address should be based on the md5
of the DEVICE name, not the VM name. Which is correct? Which is more

I suppose most people's VMs will have similar slot/func numbers for the
NIC (especially with certain config engines that always assign devices
in a specific order), and so the VM name is more likely to be unique
than the name of the tap device.

Would it make sense to include more unique information in this hash?
like the host's UUID or something, to prevent the chance of more than 1
VM on the same LAN having the same MAC if they have the same VM Name?

2) Should bhyve instead use the FreeBSD assigned OUI for these MAC

Allan Jude

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-virtualization mailing list