The igb driver currently requires a VF interface to have a non-zero MAC

address, but the associated PF is giving the VF an all zeros MAC address
when one is not administratively assigned. The driver should check for
this case and generate a random address, similar to how the linux igbvf
driver does.

Submitted by:	skoumjian@juniper.net (Scott Koumjian)
MFH:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D8399
This commit is contained in:
Sean Bruno 2016-11-07 22:24:37 +00:00
parent aabc5ce043
commit 525e07418c

View File

@ -590,11 +590,20 @@ igb_attach(device_t dev)
error = EIO;
goto err_late;
}
/* Check its sanity */
if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) {
device_printf(dev, "Invalid MAC address\n");
error = EIO;
goto err_late;
/* Check its sanity */
if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) {
if (adapter->vf_ifp) {
u8 addr[ETHER_ADDR_LEN];
arc4rand(&addr, sizeof(addr), 0);
addr[0] &= 0xFE;
addr[0] |= 0x02;
bcopy(addr, adapter->hw.mac.addr, sizeof(addr));
} else {
device_printf(dev, "Invalid MAC address\n");
error = EIO;
goto err_late;
}
}
/* Setup OS specific network interface */