View | Details | Raw Unified | Return to bug 253535
Collapse All | Expand All

(-)b/sys/dev/e1000/if_em.c (-3 / +20 lines)
Lines 1065-1075 em_if_attach_pre(if_ctx_t ctx) Link Here
1065
	}
1065
	}
1066
1066
1067
	if (!em_is_valid_ether_addr(hw->mac.addr)) {
1067
	if (!em_is_valid_ether_addr(hw->mac.addr)) {
1068
		device_printf(dev, "Invalid MAC address\n");
1068
		if (adapter->vf_ifp) {
1069
		error = EIO;
1069
			u8 addr[ETHER_ADDR_LEN];
1070
		goto err_late;
1070
			device_printf(dev, "Generate a random address\n");
1071
			arc4rand(&addr, sizeof(addr), 0);
1072
			addr[0] &= 0xFE; /* unicast */
1073
			addr[0] |= 0x02; /* locally administrated */
1074
			bcopy(addr, adapter->hw.mac.addr, sizeof(addr));
1075
		} else {
1076
			device_printf(dev, "Invalid MAC address\n");
1077
			error = EIO;
1078
			goto err_late;
1079
		}
1071
	}
1080
	}
1072
1081
1082
1073
	/* Disable ULP support */
1083
	/* Disable ULP support */
1074
	e1000_disable_ulp_lpt_lp(hw, TRUE);
1084
	e1000_disable_ulp_lpt_lp(hw, TRUE);
1075
1085
Lines 1927-1932 em_identify_hardware(if_ctx_t ctx) Link Here
1927
		device_printf(dev, "Setup init failure\n");
1937
		device_printf(dev, "Setup init failure\n");
1928
		return;
1938
		return;
1929
	}
1939
	}
1940
1941
	/* Are we a VF device? */
1942
	if ((adapter->hw.mac.type == e1000_vfadapt) ||
1943
	    (adapter->hw.mac.type == e1000_vfadapt_i350))
1944
		adapter->vf_ifp = 1;
1945
	else
1946
		adapter->vf_ifp = 0;
1930
}
1947
}
1931
1948
1932
static int
1949
static int

Return to bug 253535